Ensure deleted receivers get cleaned up#45
Merged
sahas-subramanian-frequenz merged 2 commits intofrequenz-floss:v0.x.xfrom Nov 17, 2022
Merged
Ensure deleted receivers get cleaned up#45sahas-subramanian-frequenz merged 2 commits intofrequenz-floss:v0.x.xfrom
sahas-subramanian-frequenz merged 2 commits intofrequenz-floss:v0.x.xfrom
Conversation
... by storing just a weakref to a receiver in the channel object. Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
49883f3 to
3dc9ba3
Compare
leandro-lucarella-frequenz
previously approved these changes
Nov 17, 2022
Contributor
leandro-lucarella-frequenz
left a comment
There was a problem hiding this comment.
LGTM, but I would add a note on the RELEASE_NOTES as it seems like an important bug fix, and also I would add a better explanation of what kind of problems we observed before this fix in the PR description (which will be used as the merge commit message).
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Contributor
Author
Both are done. |
sahas-subramanian-frequenz
approved these changes
Nov 17, 2022
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Broadcastreceivers were not getting cleaned up when then go out of scope, becauseBroadcastinstances were holding on to a strong reference to them. And because these receivers were not being read from anymore, but were still getting messages, their buffers would overflow, and the logs would get flooded with warnings.This PR fixes this issue by storing just weak references to the receivers in the
Broadcastinstances.