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 PeerStateActions bugs and update testing #4385
Merged
Merged
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
Rename `MuxTraceShutdown` to `MuxTraceStopping` and add `MuxTraceStopped`. This is more consistent with the errors mux can throw.
The purpose of this commit is to be able to emulate a client which refuses to talk to a remote peer. This makes it easier to simulate a case where the remote part is too far behind. This commit only introduces the new functionality but it's not yet used. This will be done in a subsequent commit.
Otherwise `block-fetch` mini-protocol deadlocks (and thus `chain-sync` deadlocks too).
coot
force-pushed
the
coot/peer-state-actions
branch
from
February 22, 2023 22:01
b6e6440
to
68c57f8
Compare
It seems we are using it in all tests, then it should be part of the node itself.
Exit chain-sync when looking for a common point on the chain. This simulates chain being too far behind.
Some ConnectionManager traces should not be emitted by the simulation.
When the monitoring loop notices a hot to warm or cold demotion it executes `deactivatePeerConnection` or `closePeerConnection` to make sure all hot or hot & warm & established mini-protocols terminate. Both operations can throw, if they do they shutdown mux. In this case we should not continue running the monitoring loop but let it die, otherwise we have a tight busy loop which will is eventually exited when mux exits.
When a hot mini-protocol exits we need to preserve the information why it did so, otherwise the outbound governor might miss that information and thus not insert any reactivation delay.
coot
force-pushed
the
coot/peer-state-actions
branch
from
February 22, 2023 22:39
68c57f8
to
426e2bd
Compare
bolt12
reviewed
Feb 23, 2023
Comment on lines
+298
to
+300
quota = if numberOfNodes > 0 | ||
then 20 `div` numberOfNodes | ||
else 100 |
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.
eheh nice find!
bolt12
approved these changes
Feb 23, 2023
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.
All looks good! :)
bors merge |
9 tasks
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.
Description
This PR fixes three bugs (two in production code, one in testing)
fixed a
hot -> warm -> hot
cycle; we used to forget the reason forhot -> warm
demotion and then use0
promtion delay.fixed exception handling in
deactivatePeerConnection
(part ofPeerStateActions
), which can result in a tight loop (eventually broken by mux shutdown)fixed a deadlock of chain-sync & block-fetch in
sim-net
: we used twodifferent
FetchClientRegistry
which blockedchain-sync
to start.This PR also includes a test which can reproduce the first bug and various
smaller code changes.
Checklist
changelog.d
directory created usingscriv
. If in doubt, see the Consensus release process.interface-CHANGELOG.md