-
-
Notifications
You must be signed in to change notification settings - Fork 510
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
[Bug]: leak in reaper connect function with terminationSignal #2878
Comments
checked again.. with version 0.33.0 it works without the leak. |
just a wild guess: it just sends true to termSignal on an error. before it always did that. (just some naive guessing obervations) ;-) im talking about this code here:
if i change it to
it doesnt leak anymore. it also doesnt make sense to me, that it should send true to termSignal if an error but it already returns before that defer is set. so its never called and just leaks into infinity.
|
i read through the main branch: for |
Hi @xsteadfastx thanks for reporting this. I see the different behaviours you described here:
// cleanupTermSignal triggers the termination signal if it was created and an error occurred.
func (c *DockerContainer) cleanupTermSignal(err error) {
if c.terminationSignal != nil && err != nil {
c.terminationSignal <- true
}
}
if err != nil {
termSignal <- true
} I think we must apply the behaviour in 1) consistently, as you suggested. |
Testcontainers version
0.34.0
Using the latest Testcontainers version?
Yes
Host OS
linux
Host arch
amd64
Go version
1.23.2
Docker version
Docker info
What happened?
im testing with
goleak.VerifyTestMain(m)
and with the new version of testcontainers there is a goroutine leak in reaper. it looks like the terminationSignal chan wont gets closed so the goroutine hangs. but its just a wild guess here.Relevant log output
Additional information
No response
The text was updated successfully, but these errors were encountered: