-
Notifications
You must be signed in to change notification settings - Fork 835
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
Detect closed notification substreams instead of evicting all peers #3983
Merged
+145
−80
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
51fbcb3
wip
altonen 891422b
Merge branch 'master' into altonen-detect-closed-connection
dmitry-markin 291271b
Add tests
dmitry-markin 29ecee6
Merge remote-tracking branch 'origin/master' into dm-detect-closed-su…
dmitry-markin 7646b53
Remove peer eviction commented-out code and leftovers
dmitry-markin f5ec4df
Add PRDoc
dmitry-markin cce48fd
Add `bump` to PRDoc
dmitry-markin a438eed
Add `sc-network` minor bump to prdoc
dmitry-markin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 | ||
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json | ||
|
||
title: Detect closed notification substreams instead of evicting all peers | ||
|
||
doc: | ||
- audience: Node Operator | ||
description: | | ||
Replace eviction of all peers when syncing has completely stalled with a more granular | ||
detection of notification substreams closed by remote peers. | ||
|
||
This change is expected to make the _reported_ peer count lower, as before this change | ||
the number also included already closed substreams. Nevertheless, the currently reported | ||
number should be seen as the real number of working connections. | ||
|
||
crates: | ||
- name: sc-network-sync | ||
bump: minor |
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
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
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
Oops, something went wrong.
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.
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.
dq: The worst that can happen now is to stall indefinitely? And we presume that previously, we evicted peers because they closed their notification substreams but we didn't notice it on time (ie before the eviction timer triggered all peers to be dropped)? 🤔
I think this is related to: #3346
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.
In order for this to happen, all peers have to keep the notification channel open and misbehave by not providing any useful data. This seems unlikely to me.
Yes, the peer eviction kicked in only if we had all notification streams half-closed, but didn't notice it.
I think we can revisit peer eviction and may be come up with a solution tracking individual peers (what has been done at some point i the past).
Also, people complained that suddenly the number of connected peers dropped to zero due to eviction. Now it should work on an individual peer level.
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.
Also, we can keep the eviction as is for now and merge only the closed substream detection, and handle eviction in a separate PR.
@lexnv @bkchr what do you think?
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.
We just added this to work around the bug that this pr is fixing, thus I think it is fine to remove this. Especially as we already have seen issues with it.