-
Notifications
You must be signed in to change notification settings - Fork 564
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
RemoveEventListener cause connection leak #911
Comments
Thanks for the detailed issue and for providing a reproducer! Yeah, if nothing is listening for the events we should probably close the connection. I'll take a closer look at this on Thursday. |
Is there a plan to fix this issue as there is an official alternative now? |
Yeah I plan to get to it before the end of the Summer, just been away for a while. |
@yyuuttaaoo @shabicheng can you try #928? |
After testing, this patch does not work. So I think the issue should be reopened.
There are 2 other problems in this solution:
So I have made another patch based on the current one. Note:
@fsouza Would you help/coauthor to make the new patch complete? |
@yyuuttaaoo thank you for detailed explanation! I can definitely work on that patch, but this week is a bit busy. I can come around some time next week and look into that patch and make sure it's ready for prime time! |
Recently both our app and docker engine found fd count increase in a short time, after looking into the go-dockerclient source code and test, we find the AddEventListener and RemoveEventListener cause the problem: RemoveEventListener will not close connection, but after remove all listener and call AddEventListener again, the client will create a new connection.
After looking into the code, we find that the
eventHijack
create the gorountine and will not return when we call RemoveEventListener :https://github.com/fsouza/go-dockerclient/blob/main/event.go#L383
Now the newest go-dockerclient version has this problem.
The test:
The text was updated successfully, but these errors were encountered: