Skip to content

fix(k8s): stop Envoy's 15s route timeout from truncating object streams - #17

Open
aicam wants to merge 2 commits into
mainfrom
fix/gateway-object-stream-timeout
Open

aicam wants to merge 2 commits into
mainfrom
fix/gateway-object-stream-timeout

Conversation

@aicam

@aicam aicam commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

What changes were proposed in this PR?

Envoy Gateway gives every HTTPRoute rule that has no timeouts block a 15s request timeout, which covers the whole response including the body. Two routes stream whole objects for as long as the transfer takes:

  • the file-service rule (/api/dataset, /api/access/dataset, /api/model, /api/access/model), which serves version zips and uploads
  • the RustFS route, which serves presigned downloads and uploads

When the 15s limit fires, the 200 and part of the body have already been sent. Envoy closes the stream, and the browser saves a truncated file. Example from the ADMAP deployment's Envoy access log for a version zip:

"path":"/api/dataset/66/versionZip?dvid=120", "duration":14999, "bytes_sent":46104568,
"response_code":200, "response_code_details":"response_timeout", "response_flags":"UT"

The resulting 46 MB file has no zip central directory, so it can't be opened.

Change: both rules now set timeouts.request: "24h". The value is declared once at the top of gateway-routes.yaml as $objectStreamTimeout. It follows the existing notebook-migration rule in the same file, which also hardcodes its timeout.

  • Why 24h: how long a transfer takes depends on object size and the client's bandwidth. 24h covers any realistic dataset download, but a connection that keeps trickling data still can't stay open forever.
  • Stalled transfers close sooner: Envoy's per-stream idle timeout (5 min by default) still applies.
  • Not changed: other API rules keep Envoy's 15s default.

Only timeouts.request is set; backendRequest is left unset, matching the other rules.

Any related issues, documentation, discussions?

Fixes apache#8445. Supersedes the chart half of apache#8446, rebased onto the current chart, which now uses RustFS instead of MinIO. The frontend half (the blob download path) is left for a separate change.

How was this PR tested?

helm template of templates/base/gateway/gateway-routes.yaml with rustfs.gateway.enabled=true renders request: "24h" on the file-service rule and on the RustFS route. The existing llmRequestTimeout (10m) and notebook-migration (3m) rules render unchanged.

Not yet tested on a live cluster. The next step is to apply the same timeouts on the ADMAP deployment (Envoy Gateway v1.6.3, which supports HTTPRoute.spec.rules[].timeouts) and re-download dataset 66 v6 to confirm the zip arrives complete.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 5.5

🤖 Generated with Claude Code

aicam and others added 2 commits October 27, 2026 13:13
Envoy Gateway gives every HTTPRoute rule without a timeouts block a 15s
request timeout. The file-service rule (version zips, uploads) and the
RustFS route (presigned downloads) stream for as long as the object
takes, so large transfers were cut off after the 200 was sent and the
browser saved a truncated file.

Both rules now take gatewayConfig.objectStreamTimeout, defaulting to
"0s" (no limit); Envoy's stream idle timeout still reaps stalled
transfers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

Large dataset file downloads are silently truncated (~15s Envoy Gateway route timeout on the MinIO presigned-URL path)

1 participant