Skip to content

fix(client): give CSV bulk calls a longer default timeout - #406

Merged
benbenbang merged 3 commits into
mainfrom
fix/404-bulk-timeout
Oct 2, 2026
Merged

benbenbang merged 3 commits into
mainfrom
fix/404-bulk-timeout

Conversation

@benbenbang

Copy link
Copy Markdown
Member

CSV bulk endpoints were sharing the 30-second default timeout meant for regular calls, which cut off legitimate whole-market downloads before the body finished arriving. Profile-bulk part 0, for example, measured 31.4 MB over 202 seconds and failed its deadline mid-body. This change gives bulk calls their own longer default while preserving explicit overrides.

  • Introduce a 600-second bulk default (DefaultBulkTimeout / DEFAULT_BULK_TIMEOUT) that CSV bulk endpoints use while no client timeout is configured.
  • Make the client timeout optional across the Go SDK, libfmp, and the Python binding so each call falls back to its endpoint's default; an explicitly set timeout still applies to every endpoint, bulk included.
  • Thread the resolved per-call deadline through PreparedRequest, the reqwest executor, and the redirect chain so each hop honours the correct timeout.
  • Add Go, Rust, and Python tests covering the bulk default, the standard default, and an explicit override for both.
  • Document the two defaults and the override rule in libfmp, the Python binding, the Go docs, and ADR 0035.

close #404

CSV bulk endpoints now use DefaultBulkTimeout (600 seconds) until a client
sets WithTimeout, instead of sharing the 30-second default meant for regular
calls. Part 0 of profile-bulk measured 31.4 MB in 202 seconds, so the shorter
default could cut off legitimate bulk downloads.

WithTimeout still applies to every endpoint once set, including bulk, and the
client tracks whether it was configured to decide between the two defaults.
The documentation now notes that CSV bulk calls default to the longer timeout
and the larger body cap until those options are set.

Add a deadline-recording transport and a test confirming bulk calls get the
bulk timeout while others get the standard one, and that WithTimeout overrides
both.
Bulk CSV bodies such as `profile-bulk` part 0 (31.4 MB over 202 s) routinely
exceeded the single 30 s transport timeout, so whole-market bulk calls failed
their deadline before the body finished arriving.

**Per-endpoint default timeout:**
* Added `DEFAULT_BULK_TIMEOUT` (600 s) alongside `DEFAULT_TIMEOUT` (30 s), and
  gave `EndpointSpec` a `default_timeout` that `get_csv` sets to the bulk value.
* The client timeout is now optional; while unset, each call uses its endpoint's
  default, and when set it still applies to every endpoint, bulk included.

**Timeout plumbing:**
* `PreparedRequest` now carries the resolved per-call deadline, which the
  reqwest executor applies, so `ReqwestExecutor::new` no longer takes a timeout.
* The redirect chain threads the resolved timeout through every hop.

**Tests and docs:**
* Added Rust and Python tests covering the bulk default, the general default,
  and an explicit timeout overriding both for bulk routes.
* Documented the two defaults and the override rule across libfmp and the
  Python binding.
Record the call deadline rule for CSV bulk descriptors in ADR 0035. The
30 s default timeout caused bulk calls to fail with a transport error
mid-body (profile-bulk part 0 measured 31.4 MB in 202 s). Bulk
descriptors now default to DEFAULT_BULK_TIMEOUT (600 s) while the client
timeout is unset; an explicit client timeout still applies to every
endpoint, bulk included.

close #404
@benbenbang
benbenbang enabled auto-merge (rebase) October 2, 2026 04:23
@github-actions github-actions Bot added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 2, 2026
@benbenbang
benbenbang merged commit 0acacef into main Oct 2, 2026
9 checks passed
@benbenbang
benbenbang deleted the fix/404-bulk-timeout branch October 2, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: bulk routes time out under the 30s default timeout

1 participant