Skip to content

SK-3023 add configurable connect/read/write timeouts (v3) - #374

Open
Devesh-Skyflow wants to merge 1 commit into
v3-release/26.7.29from
devesh/sk-3023-add-timeouts
Open

SK-3023 add configurable connect/read/write timeouts (v3)#374
Devesh-Skyflow wants to merge 1 commit into
v3-release/26.7.29from
devesh/sk-3023-add-timeouts

Conversation

@Devesh-Skyflow

Copy link
Copy Markdown
Collaborator

What

Extends the v3 HTTP config (Phase 2 of CUST-4311) with per-attempt connectTimeout, readTimeout, and writeTimeout — in seconds, at both the client-wide (Skyflow.builder()) and per-vault (VaultConfig) levels — with the same per-field precedence as the existing timeout/retry knobs.

Phase 1 (timeout + retries) shipped earlier and explicitly deferred these three to "a future phase"; this is that phase. Purely additive, no generated-code edits, no Fern bump.

How the four timeouts relate

  • timeout — the total ceiling for the whole call (every attempt + every backoff sleep). Default 60s.
  • connectTimeout / readTimeout / writeTimeout — each bounds a single phase of one attempt. Default to OkHttp's built-in 10s.

Because the phase timeouts are per attempt, their sum across retries can exceed timeout, but timeout always wins and cuts the call off.

Changes

  • VaultConfig — three Integer (seconds) fields + getters/setters.
  • Skyflow.SkyflowClientBuilder — client-wide connectTimeout(int)/readTimeout(int)/writeTimeout(int) setters + propagation.
  • VaultClient — resolve each per-field (vault → client → unset) and apply to the shared OkHttpClient only when configured, so unset keeps OkHttp's 10s default.
  • Tests — OkHttp-default-when-unset, vault/client overrides, per-field precedence, builder propagation.
  • README — settings table + "how the four timeouts relate" guidance.
  • TimeoutLiveDemo — scenario demonstrating a per-phase timeout firing before the overall ceiling.

Backward compatibility

All new fields are optional. Unset phase timeouts preserve OkHttp's 10s default — existing integrations compile and run unchanged.

Testing

16/16 HTTP-config unit tests pass (-Djacoco.skip=true; JaCoCo can't instrument Java 21 here — pre-existing, unrelated). TimeoutLiveDemo run end-to-end: overall timeout=5s cuts at ~5.0s; readTimeout=2s under a 30s overall timeout cuts at ~2.0s.

🤖 Generated with Claude Code

Extends the v3 HTTP config (Phase 2 of CUST-4311) with per-attempt
connectTimeout, readTimeout, and writeTimeout, in seconds, at both the
client-wide (Skyflow.builder()) and per-vault (VaultConfig) levels, with
the same per-field precedence as the existing timeout/retry knobs.

Unset phase timeouts leave OkHttp's built-in 10s default in place, so
existing integrations are unchanged. The overall `timeout` (callTimeout)
remains the total ceiling that bounds the whole call including retries;
the three phase timeouts bound a single phase of one attempt.

- VaultConfig: connectTimeout/readTimeout/writeTimeout fields + accessors
- Skyflow.SkyflowClientBuilder: client-wide setters + propagation
- VaultClient: resolve per-field and apply only when configured
- Tests: OkHttp-default-when-unset, vault/client overrides, per-field
- README: settings table + "how the four timeouts relate" guidance
- TimeoutAndRetryConfigExample: show the three new timeouts in the sample

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Devesh-Skyflow
Devesh-Skyflow force-pushed the devesh/sk-3023-add-timeouts branch from abdd215 to 4033a03 Compare July 28, 2026 11:43
@Devesh-Skyflow
Devesh-Skyflow changed the base branch from v3 to v3-release/26.7.29 July 29, 2026 02:55
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