Skip to content

fix: restore the 120s default HTTP timeout - #108

Merged
vks-team merged 1 commit into
mainfrom
tytv2/restore-http-timeout-120s
Aug 28, 2026
Merged

vks-team merged 1 commit into
mainfrom
tytv2/restore-http-timeout-120s

Conversation

@vks-team

Copy link
Copy Markdown
Contributor

e3ff072 (2026-03-04) lowered the default from 120s to 1s. One second is the timeout for an ENTIRE request - connect, send and receive - not just the connection, and several vServer APIs do not answer that fast. Create and update volume are the clearest case: 3646ec6 raised the value from 30s to 120s precisely because those calls were timing out.

Consumers that want something tighter can call WithTimeout(). Lowering the default affects every repository using the SDK, and the ones on v2.19+ have been running with a one-second budget without anything in their own code to show for it:

cluster-api-control-plane-vngcloud    v2.20.0                  1s
vks-controlplane-logs-worker          v2.19.3-0.20260525094658 1s
vngcloud-cluster-deputy-controller    v2.19.2                  1s

Note for whoever picks this up next: SetTimeout here is paired with SetCommonRetryCount(3) and SetCommonRetryFixedInterval(10) - ten NANOseconds, not ten seconds, since 10 is an untyped constant converted to time.Duration. With the timeout back at 120s, a single DoRequest against an unresponsive endpoint can therefore occupy a caller for up to 4 x 120s = 8 minutes. That retry configuration is a separate problem and is left alone here rather than bundled into a one-line timeout fix.

e3ff072 (2026-03-04) lowered the default from 120s to 1s. One second is the
timeout for an ENTIRE request - connect, send and receive - not just the
connection, and several vServer APIs do not answer that fast. Create and
update volume are the clearest case: 3646ec6 raised the value from 30s to 120s
precisely because those calls were timing out.

Consumers that want something tighter can call WithTimeout(). Lowering the
default affects every repository using the SDK, and the ones on v2.19+ have
been running with a one-second budget without anything in their own code to
show for it:

    cluster-api-control-plane-vngcloud    v2.20.0                  1s
    vks-controlplane-logs-worker          v2.19.3-0.20260525094658 1s
    vngcloud-cluster-deputy-controller    v2.19.2                  1s

Note for whoever picks this up next: SetTimeout here is paired with
SetCommonRetryCount(3) and SetCommonRetryFixedInterval(10) - ten NANOseconds,
not ten seconds, since 10 is an untyped constant converted to time.Duration.
With the timeout back at 120s, a single DoRequest against an unresponsive
endpoint can therefore occupy a caller for up to 4 x 120s = 8 minutes. That
retry configuration is a separate problem and is left alone here rather than
bundled into a one-line timeout fix.
@vks-team
vks-team merged commit 6ee6f71 into main Aug 28, 2026
4 checks passed
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