-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(net): Fix potential network hangs, and reduce code complexity (#7859
) * Refactor return type of poll_discover() * Simplify poll_ready() by removing preselected peers * Fix peer set readiness check * Pass task context correctly to background tasks * Make poll_discover() return Pending * Make poll_inventory() return Pending * Make poll_unready() return Poll::Pending * Simplify with futures::ready!() and ? * When there are no peers, wake on newly ready peers, or new peers, in that order * Preserve the original waker when there are no unready peers * Fix polling docs and remove unnecessary code * Make sure we're ignoring Poll::Pending not Result * Make panic checking method names clearer * Fix connection Client task wakeups and error handling * Cleanup connection panic handling and add wakeup docs * Fix connection client task wakeups to prevent hangs * Simplify error and pending handling * Clarify inventory set behaviour * Define peer set poll_* methods so they return Ok if they do something * Clarify documentation Co-authored-by: Arya <[email protected]> * Fix test that depended on preselected peers * Check ready peers for errors before sending requests to them * Fix a hanging test by not waiting for irrelevant actions * Only remove cancel handles when they are required * fix incorrect panic on termination setting * Clarify method comments Co-authored-by: Arya <[email protected]> --------- Co-authored-by: Arya <[email protected]>
- Loading branch information
Showing
12 changed files
with
594 additions
and
273 deletions.
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
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.