This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Automatically unsubscribe storage listeners when they're dropped (RCP node memory leak fix) #10454
Merged
paritytech-processbot
merged 7 commits into
paritytech:master
from
koute:master_rpc_node_memory_leak_fix
Dec 10, 2021
Merged
Automatically unsubscribe storage listeners when they're dropped (RCP node memory leak fix) #10454
paritytech-processbot
merged 7 commits into
paritytech:master
from
koute:master_rpc_node_memory_leak_fix
Dec 10, 2021
Conversation
This file contains 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
koute
added
A0-please_review
Pull request needs code review.
I3-bug
The node fails to follow expected behavior.
I8-footprint
An enhancement to provide a smaller (system load, memory, network or disk) footprint.
B5-clientnoteworthy
C1-low
PR touches the given topic and has a low impact on builders.
D3-trivial 🧸
PR contains trivial changes in a runtime directory that do not require an audit
labels
Dec 9, 2021
We're running this + Looks good so far! :) |
maciejhirsz
approved these changes
Dec 9, 2021
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.
LGTM
bkchr
reviewed
Dec 9, 2021
bkchr
approved these changes
Dec 9, 2021
bot merge |
seunlanlege
pushed a commit
to seunlanlege/substrate
that referenced
this pull request
Dec 17, 2021
… node memory leak fix) (paritytech#10454) * Automatically unsubscribe storage listeners when they're dropped * Fix tests' compilation in `sc-client-api` * Add an extra test * Align to review comments; cleanups * Update client/api/src/notifications.rs * FMT Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
grishasobol
pushed a commit
to gear-tech/substrate
that referenced
this pull request
Mar 28, 2022
… node memory leak fix) (paritytech#10454) * Automatically unsubscribe storage listeners when they're dropped * Fix tests' compilation in `sc-client-api` * Add an extra test * Align to review comments; cleanups * Update client/api/src/notifications.rs * FMT Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
ark0f
pushed a commit
to gear-tech/substrate
that referenced
this pull request
Feb 27, 2023
… node memory leak fix) (paritytech#10454) * Automatically unsubscribe storage listeners when they're dropped * Fix tests' compilation in `sc-client-api` * Add an extra test * Align to review comments; cleanups * Update client/api/src/notifications.rs * FMT Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
A0-please_review
Pull request needs code review.
C1-low
PR touches the given topic and has a low impact on builders.
D3-trivial 🧸
PR contains trivial changes in a runtime directory that do not require an audit
I3-bug
The node fails to follow expected behavior.
I8-footprint
An enhancement to provide a smaller (system load, memory, network or disk) footprint.
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.
Any subscription to a key which doesn't exist (hence the subscription will never be triggered) results in a memory leak. This PR fixes the issue by simply automatically unsubscribing the listener when the event channel through which the events are supposed to be sent is dropped.
I've also added a
trace!
log which we can enable on one of the RPC nodes and see which exact keys are not being triggered.This should also fix the leak on the
jsonrpsee
-based nodes, as the underlying issue is the same AFAIK.(I've tagged this as
B5-clientnoteworthy
since it fixes an issue which also affected third-party RPC nodes, so it might be worthwhile to mention in the public changelog that this memory leak was fixed. Feel free to downgrade toB0-silent
if you disagree.)cc FYI @tomusdrw @niklasad1 @maciejhirsz