-
Notifications
You must be signed in to change notification settings - Fork 87
Avoid memory leaks in RMQConnection dependency graph (take 4) #198
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
Conversation
Committer: Michael Klishin <[email protected]> Author: Barry Duggan <[email protected]>
…rabbitmq/rabbitmq-objc-client into rabbitmq-objc-client-194-take-3
@BarryDuggan Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@BarryDuggan Thank you for signing the Contributor License Agreement! |
Calling close on channels when closing connection
@michaelklishin I've updated the branch to close channels when closing a connection. I'm cautiously optimistic that we're headed in the right direction..... |
OK. Closing all channels is not necessary when a connection is closed, as they won't be useable any more. We can "close" (release) them without going through the |
@BarryDuggan all tests pass 10 runs in a row 👍 We need to add the new memory leak tests to the list of targets executed with |
Looks like |
We can delete them. |
Perfect. Let's do that and merge then :) Thank you! |
@michaelklishin will we be bumping the cocoapods versions / making a release for these changes? |
Yes, some time later this week. I haven't done a release in a good year so need to re-learn how that's done. |
It took me a while but @BarryDuggan let me know if I've missed anything. |
Found bug with last change, using weak for heartBeatSender is causing to be dealocated before calling start causing disconnects issues since the heartbeat is nil. Steps to reproduce:
In the image below we watch _heartBeatSender variable for changes between the init flow, the value is set but then its nil again when the instance is created. |
@axel012 please submit a PR. Thank you. |
Proposed Changes
This PR is a work in progress.
It is an attempt to solve memory leaks in this client.
These memory leaks can occur when we close a connection, make it nil, and then attempt to create a new connection.
In this case we would expect to have 1 connection, but in fact we have 2.
See this discussion for more details.
Change Made
This PR is verified by all unit tests passing.
That said it will need as many eyes on it as possible because so many areas of the code base have been touched.