-
-
Notifications
You must be signed in to change notification settings - Fork 439
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]: hijacked connection returned by ContainerExecAttach is not closed #1357
Labels
bug
An issue with the library
Comments
AlexanderYastrebov
added a commit
to AlexanderYastrebov/testcontainers-go
that referenced
this issue
Jul 10, 2023
Fixes various goroutine leaks by moving around and adding missing Close calls. Leaks were detected by github.com/AlexanderYastrebov/noleak by adding ```go // go get github.com/AlexanderYastrebov/noleak@latest // cat main_test.go package testcontainers import ( "os" "testing" "github.com/AlexanderYastrebov/noleak" ) func TestMain(m *testing.M) { os.Exit(noleak.CheckMain(m)) } ``` Not all leaks could be fixed e.g. due to testcontainers#1357 therefore this change does not add leak detector, only fixes. Updates testcontainers#321
AlexanderYastrebov
added a commit
to AlexanderYastrebov/testcontainers-go
that referenced
this issue
Jul 12, 2023
Fixes various goroutine leaks by moving around and adding missing Close calls. Leaks were detected by github.com/AlexanderYastrebov/noleak by adding ```go // go get github.com/AlexanderYastrebov/noleak@latest // cat main_test.go package testcontainers import ( "os" "testing" "github.com/AlexanderYastrebov/noleak" ) func TestMain(m *testing.M) { os.Exit(noleak.CheckMain(m)) } ``` Not all leaks could be fixed e.g. due to testcontainers#1357 therefore this change does not add leak detector, only fixes. Updates testcontainers#321
Hi @AlexanderYastrebov thanks for reporting this. I now understand the issue with the I think we can update the signature as a breaking change in an upcoming minor release if needed, although I'm planning to start working on a |
AlexanderYastrebov
added a commit
to AlexanderYastrebov/testcontainers-go
that referenced
this issue
Aug 5, 2023
Fixes various goroutine leaks by moving around and adding missing Close calls. Leaks were detected by github.com/AlexanderYastrebov/noleak by adding ```go // go get github.com/AlexanderYastrebov/noleak@latest // cat main_test.go package testcontainers import ( "os" "testing" "github.com/AlexanderYastrebov/noleak" ) func TestMain(m *testing.M) { os.Exit(noleak.CheckMain(m)) } ``` Not all leaks could be fixed e.g. due to testcontainers#1357 therefore this change does not add leak detector, only fixes. Updates testcontainers#321
AlexanderYastrebov
added a commit
to AlexanderYastrebov/testcontainers-go
that referenced
this issue
Aug 5, 2023
Fixes various goroutine leaks by moving around and adding missing Close calls. Leaks were detected by github.com/AlexanderYastrebov/noleak by adding ```go // go get github.com/AlexanderYastrebov/noleak@latest // cat main_test.go package testcontainers import ( "os" "testing" "github.com/AlexanderYastrebov/noleak" ) func TestMain(m *testing.M) { os.Exit(noleak.CheckMain(m)) } ``` Not all leaks could be fixed e.g. due to testcontainers#1357 therefore this change does not add leak detector, only fixes. Updates testcontainers#321
AlexanderYastrebov
added a commit
to AlexanderYastrebov/testcontainers-go
that referenced
this issue
Aug 6, 2023
Fixes various goroutine leaks by moving around and adding missing Close calls. Leaks were detected by github.com/AlexanderYastrebov/noleak by adding ```go // go get github.com/AlexanderYastrebov/noleak@latest // cat main_test.go package testcontainers import ( "os" "testing" "github.com/AlexanderYastrebov/noleak" ) func TestMain(m *testing.M) { os.Exit(noleak.CheckMain(m)) } ``` Not all leaks could be fixed e.g. due to testcontainers#1357 therefore this change does not add leak detector, only fixes. Updates testcontainers#321
AlexanderYastrebov
added a commit
to AlexanderYastrebov/testcontainers-go
that referenced
this issue
Aug 6, 2023
Fixes various goroutine leaks by moving around and adding missing Close calls. Leaks were detected by github.com/AlexanderYastrebov/noleak by adding ```go // go get github.com/AlexanderYastrebov/noleak@latest // cat main_test.go package testcontainers import ( "os" "testing" "github.com/AlexanderYastrebov/noleak" ) func TestMain(m *testing.M) { os.Exit(noleak.CheckMain(m)) } ``` Not all leaks could be fixed e.g. due to testcontainers#1357 therefore this change does not add leak detector, only fixes. Updates testcontainers#321
mdelapenya
pushed a commit
that referenced
this issue
Aug 9, 2023
Fixes various goroutine leaks by moving around and adding missing Close calls. Leaks were detected by github.com/AlexanderYastrebov/noleak by adding ```go // go get github.com/AlexanderYastrebov/noleak@latest // cat main_test.go package testcontainers import ( "os" "testing" "github.com/AlexanderYastrebov/noleak" ) func TestMain(m *testing.M) { os.Exit(noleak.CheckMain(m)) } ``` Not all leaks could be fixed e.g. due to #1357 therefore this change does not add leak detector, only fixes. Updates #321
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Testcontainers version
v0.21.0
Using the latest Testcontainers version?
Yes
Host OS
Linux
Host arch
x86
Go version
1.20
Docker version
Docker info
What happened?
Here
testcontainers-go/docker.go
Lines 485 to 492 in f5a4a54
cli.ContainerExecAttach returns hijacked connections which should be closed by the caller:
Unfortunately Exec returns io.Reader
testcontainers-go/container.go
Line 51 in f5a4a54
I think it should return io.ReadCloser that closes hijacked connection on Close()
See related #321
Relevant log output
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: