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

x/tools/cmd/present: playground support leaks goroutines #11507

Closed
josharian opened this issue Jul 2, 2015 · 3 comments
Closed

x/tools/cmd/present: playground support leaks goroutines #11507

josharian opened this issue Jul 2, 2015 · 3 comments
Assignees
Milestone

Comments

@josharian
Copy link
Contributor

@josharian josharian commented Jul 2, 2015

To reproduce, start present, navigate to localhost:3999 in your browser, and open a presentation. Then hit reload a bunch of times. For each reload, a new playground socket handler gets spun up, each of which permanently leaks a goroutine.

Hitting present with a SIGQUIT yields lots of these:

goroutine 52 [chan receive, 6 minutes]:
golang.org/x/tools/playground/socket.func·002()
    $GOPATH/src/golang.org/x/tools/playground/socket/socket.go:125 +0x10b
created by golang.org/x/tools/playground/socket.socketHandler
    $GOPATH/src/golang.org/x/tools/playground/socket/socket.go:131 +0x2b0

Note that in socketHandler.go line 125 there's a range loop reading from a channel that never gets closed.

Noticed because I added net/http/pprof to present for a demo and saw the goroutines profile number steadily increasing.

@josharian josharian added this to the Unreleased milestone Jul 2, 2015
@josharian
Copy link
Contributor Author

@josharian josharian commented Jul 2, 2015

As an aside, if vet had oracular powers, it could warn about such matters. There would probably be too many false positives, though. Plus oracle the lives in x/tools and somehow I don't see that changing soon.

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 28, 2015

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

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 29, 2015

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.