The GitHub Actions job "Required Checks" on 
texera.git/backport/9353-disable-the-request-timeout-on-version-z-v1.3 has 
succeeded.
Run started by GitHub user mengw15 (triggered by mengw15).

Head commit for run:
0e493b1296684cc843ae356025fefce54b23492f / Kunwoo (Chris) 
<[email protected]>
fix(k8s): disable the request timeout on version zips (#9353)

### What changes were proposed in this PR?

Problem. The static HTTPRoute rule that sends `/api/dataset`,
`/api/access/dataset`, `/api/model` and `/api/access/model` to
file-service has no `timeouts` block, so Envoy Gateway leaves the route
timeout unset and Envoy applies its 15s default. That timeout runs until
the upstream response is complete, so it covers the body too. `GET
/api/dataset/{did}/versionZip` and `GET /api/model/{mid}/versionZip`
stream a zip that file-service builds as it goes, so any version whose
zip takes longer than 15s is cut off mid-body, after the 200 has gone
out.

Fix. Adds a rule that matches only the two versionZip paths
(`^/api/(dataset|model)/\d+/versionZip$`) and sets `timeouts.request:
"0s"`, the value #9349 sets on `texera-rustfs-route`. Envoy Gateway
ranks regular-expression matches above path prefixes, so this rule wins
over `/api/dataset` and `/api/model`, and every other file-service call
keeps the 15s default.

Why "0s" and not a large finite value. In Envoy Gateway 1.6.3 a rule's
request timeout also sets the route's stream idle timeout
(`idleTimeout()` in `internal/xds/translator/route.go`). "0s" turns it
off, and a finite N sets it to max(1h, N). So a finite value would not
catch a stalled stream any sooner than an hour; it would only cap the
total download time, which grows with the archive size and the reader's
bandwidth and has no natural bound. The cost is that a stalled
versionZip stream no longer falls back to Envoy's 5-minute stream idle
timeout, and stays open until the client or file-service closes it.

```
Before:  GET /api/dataset/{did}/versionZip -> file-service rule (no timeouts) 
-> cut at 15s
After:   GET /api/dataset/{did}/versionZip -> versionZip rule (request "0s") -> 
streams to the end
```

Not included. The RustFS route is #9349. The other file-service calls
under `/api/dataset` and `/api/model` keep the 15s default.

### Any related issues, documentation, discussions?

Closes #9352. Follows #9349, which makes the same change on
`texera-rustfs-route` (#9351).

### How was this PR tested?

Rendered the static routes and ran the chart's values check.

```
cd bin/k8s && helm template texera . --namespace texera-dev --show-only 
templates/base/gateway/gateway-routes.yaml
bash bin/k8s/tests/test_helm_values.sh
```

The new rule renders with `type: RegularExpression`, `value:
"^/api/(dataset|model)/\\d+/versionZip$"` and `timeouts.request: "0s"`,
and the four PathPrefix matches still have no `timeouts`.
`test_helm_values.sh` passes (188 template value references across 60
files, 4 exempt).

Reproduced against the real file-service with Envoy 1.36.4, the Envoy
that Envoy Gateway 1.6.3 deploys, using the routes Envoy Gateway
generates for today's rule (path prefix, no route timeout) and for the
new one (`safe_regex`, `timeout: 0s`, `idle_timeout: 0s`), with its 32
KiB connection buffer limits. The local dataset's zip is only 3.9 MB,
and a slow reader alone could not show the cut, because Envoy had passed
the whole body to the loopback socket buffers before the 15s ran out. A
hop that throttles file-service's response to 100 KiB/s stood in for a
version whose zip takes longer than 15s to build. Before, the download
was cut at 16.0s after 813,383 of 3,913,563 bytes (HTTP 200, curl exit
18), and Envoy counted one `upstream_rq_timeout`. After, all 3,913,563
bytes arrived in 46s. On the same listener, `/api/dataset/list` still
took the prefix rule, and `/api/model/1/versionZip` reached file-service
through the new rule.

No Kubernetes cluster was used. Envoy Gateway's translation of the rule
was checked by reading its 1.6.3 source (`processRouteTimeout`,
`buildXdsRoute` and `idleTimeout()`, and the route sort that ranks
regular expressions above prefixes), not by deploying it.

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

Generated-by: Claude Code, Claude Opus 5.5

---------

(backported from commit b4b06482e84f83e114891dc3086bdf3bcd1c9817)

Co-authored-by: Meng Wang <[email protected]>

Report URL: https://github.com/apache/texera/actions/runs/42551698752

With regards,
GitHub Actions via GitBox

Reply via email to