Skip to content

fix(gateway): bound every peer HTTPS exchange by the sync timeout - #1374

Merged
kvinwang merged 2 commits into
nextfrom
fix/gateway-peer-https-timeout
Sep 24, 2026
Merged

kvinwang merged 2 commits into
nextfrom
fix/gateway-peer-https-timeout

Conversation

@kvinwang

@kvinwang kvinwang commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

HttpsClient (hyper-util legacy client) has no connect or request timeout. SyncManager bounds sync rounds with sync.timeout, but fetch_peers_from_bootnode calls the client directly, both in ProxyInner::new (before the proxy binds its listeners) and in the retry loop. A bootnode that completes the TLS handshake and never answers hangs the gateway at startup.

HttpsClientConfig gains a timeout, set from sync.timeout (30s default), applied to each request including the body read.

Verification: new test a_peer_that_never_answers_does_not_hang_the_client (before the fix: Elapsed(()) after 10s). cargo test -p dstack-gateway 309 passed; fmt and clippy clean.

@kvinwang
kvinwang merged commit aedc7a2 into next Sep 24, 2026
14 checks passed
@kvinwang
kvinwang deleted the fix/gateway-peer-https-timeout branch September 24, 2026 14:24
kvinwang added a commit that referenced this pull request Sep 25, 2026
…t and lock tests

PR #1380 refuses a sync or push envelope that claims the target's own
node id; tc-gw-cluster-ad-002 sends one on both routes. tc-gw-kv-009 now
requires by name the bounded peer client test (#1374) and the atomic
lease-lock tests (#1357).

Signed-off-by: Kevin Wang <wy721@qq.com>
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