Skip to content

peer: Implement explicit deadlines.#3705

Merged
davecgh merged 1 commit into
decred:masterfrom
davecgh:peer_explicit_deadlines
Jun 23, 2026
Merged

peer: Implement explicit deadlines.#3705
davecgh merged 1 commit into
decred:masterfrom
davecgh:peer_explicit_deadlines

Conversation

@davecgh

@davecgh davecgh commented Jun 4, 2026

Copy link
Copy Markdown
Member

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.

@davecgh davecgh added this to the 2.2.0 milestone Jun 4, 2026
@davecgh davecgh force-pushed the peer_explicit_deadlines branch from 952b391 to a356942 Compare June 5, 2026 01:12
Comment thread peer/peer.go Outdated
@davecgh davecgh force-pushed the peer_explicit_deadlines branch from a356942 to 3ba149b Compare June 14, 2026 03:43
@davecgh davecgh force-pushed the peer_explicit_deadlines branch from 3ba149b to ab8c071 Compare June 15, 2026 04:32
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.
@davecgh davecgh force-pushed the peer_explicit_deadlines branch from ab8c071 to 04cd5a6 Compare June 23, 2026 14:50
@davecgh davecgh merged commit 04cd5a6 into decred:master Jun 23, 2026
32 checks passed
@davecgh davecgh deleted the peer_explicit_deadlines branch June 23, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants