kunwp1 opened a new pull request, #9353:
URL: https://github.com/apache/texera/pull/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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to