Skip to content

Avoid reusing closing socket pool routes - #257

Open
marcus-pousette-hp wants to merge 5 commits into
mainfrom
fix/avoid-closing-socket-pool-routes
Open

Avoid reusing closing socket pool routes#257
marcus-pousette-hp wants to merge 5 commits into
mainfrom
fix/avoid-closing-socket-pool-routes

Conversation

@marcus-pousette-hp

@marcus-pousette-hp marcus-pousette-hp commented May 18, 2026

Copy link
Copy Markdown
Contributor

Reusable socket routes were previously removed only after the underlying socket emitted close. During the interval between calling socket.close() and receiving that event, route lookup could return a socket with socket.closing === true.
Attempting to reuse that route causes an unnecessary failed connection attempt before falling back to the normal connection path, potentially increasing reconnect latency and flakiness during connection churn.

This change:

  • Removes closing routes during lookup.
  • Replaces a closing route when a healthy route for the same peer is registered.

Co-authored with AI

@marcus-pousette-hp
marcus-pousette-hp requested a review from a team May 18, 2026 21:31
@marcus-pousette-hp
marcus-pousette-hp force-pushed the fix/avoid-closing-socket-pool-routes branch from b872b5c to 55711e6 Compare July 16, 2026 10:48
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.

1 participant