-
Notifications
You must be signed in to change notification settings - Fork 117
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(net): Avoid potential concurrency bugs in outbound handshakes #6869
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
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6869 +/- ##
==========================================
- Coverage 77.73% 77.68% -0.06%
==========================================
Files 310 310
Lines 41416 41441 +25
==========================================
- Hits 32196 32194 -2
- Misses 9220 9247 +27 |
arya2
approved these changes
Jun 8, 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.
This is marvelous, thank you.
dconnolly
pushed a commit
that referenced
this pull request
Jun 12, 2023
) * Stop sending peer errors on the PeerSet channel, to respect send limits * Move locking out of the cralwer select!, potential deadlock or hang risk * Move report_failed() out of the CandidateSet, reducing concurrency risks * Make CandidateSet Send * Make all CandidateSet operations concurrent, previous hand/deadlock bug * Reduce the gap between handshakes and peer set updates, and exit the task on shutdown
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-concurrency
Area: Async code, needs extra work to make it work properly.
A-network
Area: Network protocol updates or fixes
C-bug
Category: This is a bug
C-security
Category: Security issues
I-hang
A Zebra component stops responding to requests
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.
Motivation
This PR fixes a bunch of potential concurrency bugs in Zebra's outbound handshake code.
Part of #6763.
This is not a blocker for the first stable release.
Complex Code or Requirements
This is concurrent code, but the final code should be a lot easier to reason about than the previous code, because it's all running concurrently in independent tasks.
Solution
Testing
Our existing unit and integration tests have good coverage of this code, and "is this task concurrent" is hard to test.
Review
@arya2 and I discussed part of this design about a week ago.
I can split this into 2-3 PRs if it would be easier, or do a video review.
Reviewer Checklist
Follow Up Work
Try diagnosing any remaining bugs in #6763.