-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix CallbackRegistry memory leak #19480
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 CallbackRegistry memory leak #19480
Conversation
e6de4db
to
c64b4c7
Compare
Do you really expect a coverage of 100%? The warn from Another point is the |
We prefer full coverage but allow ourselves some human judgment when pieces of code are very hard to test. |
del self.callbacks[signal] | ||
del self._func_cid_map[signal] | ||
for signal, proxy_to_cid in list(self._func_cid_map.items()): | ||
cid = proxy_to_cid.pop(proxy, None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To check my understanding, The change on L221 and L241 are the critical changes in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. And i have just apply the same pattern to the disconnect.
c64b4c7
to
ab10d45
Compare
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modulo the change to the docsting.
Thanks @vallsv !
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
Let me know if you prefer better commit history. |
If you don't mind squashing that would be appreciated. We can also squash-merge on our side. |
@anntzer did you have time to take a quick look at this? Though it could prob be bumped to 3.4.1 as well if folks prefer. |
I would also be comfortable merging this between an rc and a final release. |
Can you also remove cid from pickled_cids, as suggested at the end of #19345 (comment)? |
@vallsv I took the liberty of pushing commits to this branch to address the remaining memory leak. |
Nice. Thanks for the merge. |
PR Summary
This PR fixes the issue #19474, and probably the issue #19345
disconnect
A much shorter change count be done to only fix the issue, if you like.
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).