Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: TestDialParallel leaks worker goroutines and inflight sockets #11878

Closed
mikioh opened this issue Jul 27, 2015 · 2 comments
Closed

net: TestDialParallel leaks worker goroutines and inflight sockets #11878

mikioh opened this issue Jul 27, 2015 · 2 comments
Milestone

Comments

@mikioh
Copy link
Contributor

mikioh commented Jul 27, 2015

git rev-parse HEAD
fb738b38c0bc1570286405ab57fe6b8cda655714

go test -v -run=TestDialParallel
=== RUN   TestDialParallel
--- PASS: TestDialParallel (1.91s)
PASS
Running goroutines:
net.runtime_pollWait(0x582e88, 0x77, 0xc820108570)
        /go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc820106a00, 0x77, 0x0, 0x0)
        /go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitWrite(0xc820106a00, 0x0, 0x0)
        /go/src/net/fd_poll_runtime.go:82 +0x36
net.(*netFD).connect(0xc8201069a0, 0x0, 0x0, 0x582728, 0xc8201043e0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/net/fd_unix.go:114 +0x1f6
net.(*netFD).dial(0xc8201069a0, 0x582840, 0x0, 0x582840, 0xc8201030b0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/net/sock_posix.go:137 +0x351
net.socket(0x318ec8, 0x3, 0x2, 0x1, 0x0, 0xc820103000, 0x582840, 0x0, 0x582840, 0xc8201030b0, ...)
        /go/src/net/sock_posix.go:89 +0x411
net.internetSocket(0x318ec8, 0x3, 0x582840, 0x0, 0x582840, 0xc8201030b0, 0x0, 0x0, 0x0, 0x1, ...)
        /go/src/net/ipsock_posix.go:160 +0x141
net.dialTCP(0x318ec8, 0x3, 0x0, 0xc8201030b0, 0x0, 0x0, 0x0, 0xc81ffff66b, 0x0, 0x0)
        /go/src/net/tcpsock_posix.go:171 +0x11e
net.slowDialTCP(0x318ec8, 0x3, 0x0, 0xc8201030b0, 0x0, 0xc800000000, 0x0, 0x52e000, 0x0, 0x0)
        /go/src/net/dial_test.go:234 +0x8e
net.dialSingle(0xc820114100, 0x582590, 0xc8201030b0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/net/dial.go:364 +0x3f5
net.dialSerial.func1(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/net/dial.go:336 +0x75
net.dial(0x318ec8, 0x3, 0x582590, 0xc8201030b0, 0xc82011dde0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /go/src/net/fd_unix.go:40 +0x60
net.dialSerial(0xc820114100, 0xc820104360, 0x2, 0x2, 0xc82010c5a0, 0x0, 0x0, 0x0, 0x0)
        /go/src/net/dial.go:338 +0x760
net.dialSerialAsync(0xc820114100, 0xc820104360, 0x2, 0x2, 0x0, 0xc82010c5a0, 0xc82010c540)
        /go/src/net/dial.go:299 +0xe5
created by net.dialParallel
        /go/src/net/dial.go:257 +0x118
net.runtime_pollWait(0x583188, 0x77, 0xc820108200)
        /go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc820106450, 0x77, 0x0, 0x0)
        /go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitWrite(0xc820106450, 0x0, 0x0)
        /go/src/net/fd_poll_runtime.go:82 +0x36
net.(*netFD).connect(0xc8201063f0, 0x0, 0x0, 0x582728, 0xc820104180, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/net/fd_unix.go:114 +0x1f6
net.(*netFD).dial(0xc8201063f0, 0x582840, 0x0, 0x582840, 0xc820102600, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/net/sock_posix.go:137 +0x351
net.socket(0x318ec8, 0x3, 0x2, 0x1, 0x0, 0xc820102600, 0x582840, 0x0, 0x582840, 0xc820102600, ...)
        /go/src/net/sock_posix.go:89 +0x411
net.internetSocket(0x318ec8, 0x3, 0x582840, 0x0, 0x582840, 0xc820102600, 0x0, 0x0, 0x0, 0x1, ...)
        /go/src/net/ipsock_posix.go:160 +0x141
net.dialTCP(0x318ec8, 0x3, 0x0, 0xc820102600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/net/tcpsock_posix.go:171 +0x11e
net.slowDialTCP(0x318ec8, 0x3, 0x0, 0xc820102600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/net/dial_test.go:234 +0x8e
net.dialSingle(0xc820114000, 0x582590, 0xc820102600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/net/dial.go:364 +0x3f5
net.dialSerial.func1(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/net/dial.go:336 +0x75
net.dial(0x318ec8, 0x3, 0x582590, 0xc820102600, 0xc82005fde0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /go/src/net/fd_unix.go:40 +0x60
net.dialSerial(0xc820114000, 0xc8201081b0, 0x1, 0x1, 0xc82010c1e0, 0x0, 0x0, 0x0, 0x0)
        /go/src/net/dial.go:338 +0x760
net.dialSerialAsync(0xc820114000, 0xc8201081b0, 0x1, 0x1, 0x0, 0xc82010c1e0, 0xc82010c180)
        /go/src/net/dial.go:299 +0xe5
created by net.dialParallel
        /go/src/net/dial.go:257 +0x118

Inflight sockets:
16: (inet4, stream, default): syscallerr=<nil>, socketerr=<nil>
12: (inet4, stream, default): syscallerr=<nil>, socketerr=<nil>

Socket statistical information:
(inet4, stream, default): opened=26, connected=5, listened=14, accepted=5, closed=29, openfailed=0,\
 connectfailed=12, listenfailed=0, acceptfailed=14, closefailed=0
(inet6, stream, default): opened=22, connected=6, listened=13, accepted=6, closed=27, openfailed=0,\
 connectfailed=9, listenfailed=0, acceptfailed=15, closefailed=0

ok      net     1.929s

@pmarks-net

@mikioh mikioh added this to the Go1.6 milestone Jul 27, 2015
@pmarks-net
Copy link
Contributor

Ah, this happens because TestDialParallel is not setting the new finalDeadline field.

@gopherbot
Copy link

CL https://golang.org/cl/12712 mentions this issue.

@mikioh mikioh modified the milestones: Go1.5, Go1.6 Jul 28, 2015
@golang golang locked and limited conversation to collaborators Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants