-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
libp2p.Host leaks goroutines #2514
Comments
👍 I was able to repro this. func TestShutdown(t *testing.T) {
defer goleak.VerifyNone(t)
h1, err := libp2p.New()
require.NoError(t, err)
defer h1.Close()
time.Sleep(time.Second * 10) // still fails
} |
@Jorropo I tried the long sleep too, but no luck :( |
Does this problem appear on v0.30.0 too? |
Yes, I have tried it with v0.30.0. |
@sukunrt mind taking a look? |
I think it's related to this: #2118 We haven't done the work to stop some services that are started by FX. In this case it might be the quicreuse stuff. |
Yes, using Fx would fix this. I’m not sure we’ll have the time to get this PR in before the v0.31 release, but if not, we should really prioritize it for the next one. Adding a test using goleak seems like a good idea as well. |
Creating a new host and closing it leaks goroutines.
The following simple test produces the following errors when run: (goleak is a library that detects leaked goroutines
VerifyNone
fails the test if more goroutines exist at the end of the test than at the beginning)This problem appears in: v0.29.2, v0.30.0 (and possibly prior versions, not yet tested)
Version Information
The text was updated successfully, but these errors were encountered: