Reduce node handshake read timeout from 60s to 5s#13357
Open
JakeRadMSFT wants to merge 1 commit intodotnet:mainfrom
Open
Reduce node handshake read timeout from 60s to 5s#13357JakeRadMSFT wants to merge 1 commit intodotnet:mainfrom
JakeRadMSFT wants to merge 1 commit intodotnet:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces the node-side handshake read timeout to prevent idle nodes from being blocked for long periods when a reuse probe connects but doesn’t complete the handshake, allowing the node to more promptly re-check its idle/connection timeout logic.
Changes:
- Reduced
ClientConnectTimeoutfrom 60s to 5s in the out-of-proc node endpoint (NETCOREAPP2_1+). - Updated inline comments around handshake reads to match the shorter timeout.
This was referenced Mar 10, 2026
Idle nodes block in WaitForConnection, then read the handshake with a 60s timeout. If a reuse probe connects but the handshake fails or stalls, the node is blocked for up to 60s before it can check the idle timeout and exit. This means nodes can linger much longer than the configured idle timeout. Reducing to 5s means a failed handshake only blocks the node briefly, allowing it to loop back and check the connection timeout promptly. Also updates stale 'wait a long time' comments to match the new timeout.
9c39855 to
5018488
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.
Problem
Idle nodes block in
WaitForConnection, then read the handshake with a 60s timeout (ClientConnectTimeout). If a reuse probe connects but the handshake fails or stalls, the node is blocked for up to 60s before it can loop back and check the idle timeout. This means nodes can linger much longer than the configured idle timeout.Fix
Reduce
ClientConnectTimeoutfrom 60s to 5s. A failed handshake now only blocks the node briefly, allowing it to promptly re-check whether it should exit.Also updates stale "wait a long time" comments to match the new timeout value.
Split from #13336 per reviewer request. @baronfel asked @rainersigwald about this change — the message processing pump is single-threaded, so a long block here prevents the node from servicing other work.