Repository navigation
Give each outbound connect attempt one second instead of 250 ms - #1376
Merged
Merged
Conversation
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
Telegram calls on Cloud fail now and then with
ETIMEDOUTafter only 0.5 s (7 calls in 6 workspaces on 31 Oct, 12 in 6 the day before, mostlytelegram_bot_get_updatesandsend_message).api.telegram.orghas an IPv4 and an IPv6 address. For such hosts Node's happy-eyeballs gives each address only 250 ms (autoSelectFamilyAttemptTimeout), and the Cloud containers have no IPv6 route, so one lost SYN on the IPv4 attempt is enough to fail the whole call.Changes
createSsrfGuardedAgents(the agents every outbound connector call uses) setsautoSelectFamilyAttemptTimeoutto 1,000 ms. A lost SYN is retried inside the attempt, and the fallback to the next address still comes after one second. The 5 s socket timeout is unchanged.Type
Testing
In packages/backend:
npx jest src/common/ssrf.util.spec.ts src/common/outbound-http.spec.ts src/common/outbound-fetch.util.spec.ts(81 passed),npx eslinton the two files,npx tsc --noEmit -p tsconfig.json. Same in Cloud and self-hosted; it only matters for hosts with several addresses where the first attempt is slow.Checklist
Related Issues
Daily check 2026-10-31 (proposed) and 2026-11-01, cloud.md candidate 6.