-
Notifications
You must be signed in to change notification settings - Fork 212
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
[Merged by Bors] - p2p: server: adjust deadline during long reads and writes #5463
Closed
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 ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #5463 +/- ##
========================================
Coverage 77.6% 77.6%
========================================
Files 267 268 +1
Lines 30956 31184 +228
========================================
+ Hits 24045 24224 +179
- Misses 5396 5431 +35
- Partials 1515 1529 +14 ☔ View full report in Codecov by Sentry. |
ivan4th
force-pushed
the
feature/adjust-deadline
branch
from
January 18, 2024 03:26
869fc1a
to
d63ca14
Compare
bors try |
tryBuild succeeded: |
poszu
reviewed
Jan 25, 2024
Co-authored-by: Bartosz Różański <[email protected]>
poszu
approved these changes
Jan 25, 2024
bors merge |
spacemesh-bors bot
pushed a commit
that referenced
this pull request
Jan 25, 2024
## Motivation Currently, if a request takes too long to complete due to the data size and/or the speed of network connection, the requests often time out before the completion. This happens because stream deadline is set just once at the start of the request and not updated till it is completed. The timeouts cause a lot of `i/o deadline exceeded` errors, and also cause the nodes with high peer counts to be hammered by repeated retries by peers that fail to get ATX ID list for epoch, ActiveSets etc. Moreover, nodes may prevent themselves from retrieving the full response to request they make because of the timeouts. ## Changes In `p2p/server`, split large reads / writes into 4 KiB chunks. Update stream deadline after each chunk is read/written. ## Test Plan Verified the approach to work using emulated low-bandwidth node-to-node sync env: https://gist.github.com/ivan4th/c8add0b4d6a6fffb3da248b6b6bac346 Verified the approach to work on a node with high peer count Verified normal mainnet syncing Co-authored-by: Ivan Shvedunov <[email protected]>
Pull request successfully merged into develop. Build succeeded: |
spacemesh-bors
bot
changed the title
p2p: server: adjust deadline during long reads and writes
[Merged by Bors] - p2p: server: adjust deadline during long reads and writes
Jan 25, 2024
ivan4th
added a commit
that referenced
this pull request
Jan 25, 2024
## Motivation Currently, if a request takes too long to complete due to the data size and/or the speed of network connection, the requests often time out before the completion. This happens because stream deadline is set just once at the start of the request and not updated till it is completed. The timeouts cause a lot of `i/o deadline exceeded` errors, and also cause the nodes with high peer counts to be hammered by repeated retries by peers that fail to get ATX ID list for epoch, ActiveSets etc. Moreover, nodes may prevent themselves from retrieving the full response to request they make because of the timeouts. ## Changes In `p2p/server`, split large reads / writes into 4 KiB chunks. Update stream deadline after each chunk is read/written. ## Test Plan Verified the approach to work using emulated low-bandwidth node-to-node sync env: https://gist.github.com/ivan4th/c8add0b4d6a6fffb3da248b6b6bac346 Verified the approach to work on a node with high peer count Verified normal mainnet syncing Co-authored-by: Ivan Shvedunov <[email protected]>
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.
Motivation
Currently, if a request takes too long to complete due to the data size and/or the speed of network connection, the requests often time out before the completion. This happens because stream deadline is set just once at the start of the request and not updated till it is completed. The timeouts cause a lot of
i/o deadline exceeded
errors, and also cause the nodes with high peer counts to be hammered by repeated retries by peers that fail to get ATX ID list for epoch, ActiveSets etc. Moreover, nodes may prevent themselves from retrieving the full response to request they make because of the timeouts.Changes
In
p2p/server
, split large reads / writes into 4 KiB chunks. Update stream deadline after each chunk is read/written.Test Plan
Verified the approach to work using emulated low-bandwidth node-to-node sync env: https://gist.github.com/ivan4th/c8add0b4d6a6fffb3da248b6b6bac346
Verified the approach to work on a node with high peer count
Verified normal mainnet syncing