Skip to content

Conversation

@gacevicljubisa
Copy link
Member

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 15s timeout
  • Add explicit parent context cancellation check before each connection attempt
  • Remove redundant timeout wrapper in kademlia connect method
  • Prevents later addresses from being starved of connection time
  • Still respects upstream cancellations (shutdown, etc.)

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.

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.

4 participants