Skip to content

[ws-daemon] Close grpc server and daemon socket #3824

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

Merged
merged 1 commit into from
Apr 7, 2021
Merged

Conversation

aledbf
Copy link
Member

@aledbf aledbf commented Apr 7, 2021

How to test:

The output should contain

1 @ 0x43aec5 0x43351b 0x46c1f5 0x4e5965 0x4e87d2 0x4e87b4 0x573085 0x594992 0x593025 0x94f57f 0x1274de5 0x471e61
#	0x46c1f4	internal/poll.runtime_pollWait+0x54								/home/gitpod/sdk/go1.16/src/runtime/netpoll.go:222
#	0x4e5964	internal/poll.(*pollDesc).wait+0x44								/home/gitpod/sdk/go1.16/src/internal/poll/fd_poll_runtime.go:87
#	0x4e87d1	internal/poll.(*pollDesc).waitRead+0x211							/home/gitpod/sdk/go1.16/src/internal/poll/fd_poll_runtime.go:92
#	0x4e87b3	internal/poll.(*FD).Accept+0x1f3								/home/gitpod/sdk/go1.16/src/internal/poll/fd_unix.go:401
#	0x573084	net.(*netFD).accept+0x44									/home/gitpod/sdk/go1.16/src/net/fd_unix.go:172
#	0x594991	net.(*UnixListener).accept+0x31									/home/gitpod/sdk/go1.16/src/net/unixsock_posix.go:162
#	0x593024	net.(*UnixListener).Accept+0x64									/home/gitpod/sdk/go1.16/src/net/unixsock.go:260
#	0x94f57e	google.golang.org/grpc.(*Server).Serve+0x27e							/workspace/go/pkg/mod/google.golang.org/[email protected]/server.go:739
#	0x1274de4	github.com/gitpod-io/gitpod/ws-daemon/pkg/iws.(*InWorkspaceServiceServer).Start.func1+0x64	/tmp/build/components-ws-daemon--app.1288025c7c291992e5141266b8ebcdd45111fc45/pkg/iws/iws.go:172
  • Stop the workspace.
  • After that, refresh http://localhost:6060/debug/pprof/goroutine
  • Search for iws.go:172. It should not be found and the number of goroutines should be lower.

fixes #3108

@aledbf aledbf force-pushed the aledbf/wsdaemonleak branch from 03502a0 to ad94fde Compare April 7, 2021 19:23
Comment on lines -105 to +109
stopFn, ok := rawStop.(context.CancelFunc)
stopFn, ok := rawStop.(func())
Copy link
Member Author

@aledbf aledbf Apr 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assert was incorrect.

@aledbf aledbf marked this pull request as ready for review April 7, 2021 19:37
@aledbf aledbf requested a review from csweichel April 7, 2021 19:37
@aledbf aledbf changed the title [ws-daemon] Closing grpc server and daemon socket [ws-daemon] Close grpc server and daemon socket Apr 7, 2021
@aledbf aledbf mentioned this pull request Apr 7, 2021
24 tasks
Copy link
Member

@meysholdt meysholdt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tried it, works as advertised, thank you!

@meysholdt meysholdt merged commit 745dfbc into main Apr 7, 2021
@meysholdt meysholdt deleted the aledbf/wsdaemonleak branch April 7, 2021 20:22
pavan-tri pushed a commit to trilogy-group/gitpod that referenced this pull request Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ws-daemon go routine leak
2 participants