peer: Implement explicit deadlines.#3705
Merged
Merged
Conversation
952b391 to
a356942
Compare
jholdstock
reviewed
Jun 14, 2026
a356942 to
3ba149b
Compare
jholdstock
approved these changes
Jun 14, 2026
3ba149b to
ab8c071
Compare
dajohi
approved these changes
Jun 23, 2026
The current deadline code for expected responses is fairly loose in that it groups message types together. It works well enough for most cases, but that looseness means it is often slightly incorrect, particularly now that there many more mixing messages competing with other data types and messages which can lead to undesirable behavior. It also has some very old logic that doesn't apply anymore and can lead to erroneous timeouts. For example, now that the handshake is done prior to starting async processing and handles the deadline itself, those messages are no longer apply to the async machinery. This addresses the aforementioned by making the deadline tracking much more explicit by tracking every data request and matching up the responses by type and hash as well as removing some of the messages that are not guaranteed to have responses.
ab8c071 to
04cd5a6
Compare
This file contains hidden or 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
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.
This requires #3703.
The current deadline code for expected responses is fairly loose in that it groups message types together. It works well enough for most cases, but that looseness means it is often slightly incorrect, particularly now that there many more mixing messages competing with other data types and messages which can lead to undesirable behavior.
It also has some very old logic that doesn't apply anymore and can lead to erroneous timeouts. For example, now that the handshake is done prior to starting async processing and handles the deadline itself, those messages are no longer apply to the async machinery.
This addresses the aforementioned by making the deadline tracking much more explicit by tracking every data request and matching up the responses by type and hash as well as removing some of the messages that are not guaranteed to have responses.