-
Notifications
You must be signed in to change notification settings - Fork 616
Fix connection leaks on auto recovery #1145
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
Fix connection leaks on auto recovery #1145
Conversation
|
@mot256 Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
|
@mot256 Thank you for signing the Contributor License Agreement! |
|
Hello @mot256 thank you for your contribution. Could you please edit the description of this pull request and fill out the requested information? "Proposed Changes", "Types of Changes", "Checklist" and "Further Comments". We can't accept a pull request without any context. We also need to know how to reproduce the issue that this pull request solves. How did you discover the issue? |
|
@lukebakken Thanks for the quick reply. I have updated the PR description as best I could without trying to clutter it with too much detail. |
|
There are no tests that affect network sockets. @mot256 can you please rebase your PR and explain how we can reasonably reliably reproduce the issue? |
So for instance, you have a publisher using an It would be helpful if you shared the program you're using to test just so I am more certain of how you're testing. Thanks. |
|
@michaelklishin @lukebakken apologies for the late reply. I've been hunting another issue. Thankyou for merging the PR. |
|
@lukebakken just a question (from a first timer in this repo) what is the process to merging this to 7.x and/or main branch? |
|
@mot256 we backport or forward port, and ask for your help with resolving conflicts if anything major pops up. |
Port PR #1145 to main, manually
|
Hello, |
|
@mantasaudickas scanning through both #1061 and #1067 and it does feel like the same issues I experienced, hence this PR. It would be interesting to know if it did. Could you maybe retest with 6.2.4 and see? |
Proposed Changes
While trying to reproduce RabbitMQ (re)connection issues we found in production, memory profiling showed us that instances of RabbitMQ.Client.Framing.Impl.Connection (and other related objects) are never released and are thus pinned for the life time of the application domain (even if RabbitMQ.Client.Framing.Impl.AutorecoveringConnection is disposed and released from memory)
We have found that this happened in 2 main scenarios:
The second scenario above is of particular concern, as this not only causes memory leaks, it also keeps connections alive to the server (at least until there is a socket disconnect detected by the OS). Which in turn causes "dead lock" scenarios when exclusive consumers are being recovered, but some other error occurred there after while recovering the rest of the topology.
Types of Changes
What types of changes does your code introduce to this project?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creatingthe PR. If you're unsure about any of them, don't hesitate to ask on the
mailing list. We're here to help! This is simply a reminder of what we are
going to look for before merging your code.
CONTRIBUTING.mddocumentFurther Comments
N/A