Repository navigation
Give each connect attempt 3.5 s so a resent SYN can land - #1436
Merged
Merged
Conversation
helpcodeai
enabled auto-merge (squash)
November 2, 2026 08:30
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
#1376 raised the per-address connect attempt (
autoSelectFamilyAttemptTimeout) from Node's 250 ms to 1 s for the SSRF-guarded agents. On Cloud the TelegramETIMEDOUTerrors did not stop; they moved to the new limit: 7 calls in 5 workspaces on 1 Nov failed after 1,019 to 1,162 ms. Linux resends a lost SYN after 1 s and again after 3 s, so a 1 s attempt ends just before the first resend can succeed.Each attempt now gets 3.5 s, which covers both resends and still ends before the agent's 5 s socket timeout. A host whose IPv6 has no route fails that address at once, so the fallback speed for dual-stack hosts is unchanged in the Cloud containers.
Cloud and self-hosted behave the same.
Changes
packages/backend/src/common/ssrf.util.ts:CONNECT_ATTEMPT_TIMEOUT_MS1000 → 3500, comment with the evidence.packages/backend/src/common/ssrf.util.spec.ts: the value must be above 3 s and below the 5 s agent timeout.Type
Testing
Related Issues
Follow-up to #1376.