Skip to content

fix(p2p): give each underlay address fresh 10s connection timeout#5328

Open
gacevicljubisa wants to merge 2 commits intomasterfrom
fix/connection-timeout-per-address
Open

fix(p2p): give each underlay address fresh 10s connection timeout#5328
gacevicljubisa wants to merge 2 commits intomasterfrom
fix/connection-timeout-per-address

Conversation

@gacevicljubisa
Copy link
Member

@gacevicljubisa gacevicljubisa commented Jan 23, 2026

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

  • Use context.WithoutCancel to give each underlay address a fresh 10s timeout
  • Add explicit parent context cancellation check before each connection attempt
  • Prevents later addresses from being starved of connection time
  • Still respects upstream cancellations (shutdown, etc.)
  • Use 45s total timeout in kademlia

Previously, all connection attempts shared the parent's 15s timeout,
causing later addresses to have insufficient time. Now each address
gets a full 15s attempt while still checking for parent cancellation
between attempts.

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

Copy link
Member

@janos janos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok.

@acud acud added this to the v2.8.0 milestone Feb 4, 2026
@gacevicljubisa gacevicljubisa changed the title fix(p2p): give each underlay address fresh 15s connection timeout fix(p2p): give each underlay address fresh 10s connection timeout Feb 6, 2026
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.

5 participants