Aias00 opened a new issue, #7931:
URL: https://github.com/apache/shenyu/issues/7931

   ## Goal
   Give a request one gateway-owned time budget so queueing, plugin external 
calls, retries and upstream attempts cannot each independently consume a full 
timeout after earlier work has used the available time.
   
   ## Existing capabilities and boundary
   HTTP/AI calls already have timeout and retry settings. #7560 addresses WASM 
execution deadlines and memory limits. This proposal coordinates remaining time 
across the request chain; it does not replace those component limits or claim 
that reactive cancellation can forcibly stop arbitrary synchronous code.
   
   ## MVP
   - Create a request-scoped monotonic deadline from explicit gateway 
configuration. Start at admission and make remaining time available through a 
small shared runtime contract.
   - For each supported queue/external call/retry, use the smaller of its 
existing configured limit and the remaining request budget; do not begin a new 
attempt after expiry.
   - Start with the standard non-streaming HTTP forwarding path and enumerate 
supported plugin integrations. Report unsupported boundaries honestly rather 
than claiming universal enforcement.
   - Specify optional inbound/outbound deadline propagation separately. 
Untrusted client headers cannot extend the configured maximum; wall-clock 
timestamps must not become the local elapsed-time clock.
   - Define expiry before/after response commitment, cancellation cleanup and 
fallback behavior. Streaming must explicitly distinguish 
time-to-first-response, idle timeout and maximum session lifetime; avoid 
applying a short buffered-response deadline to SSE/WebSocket by accident.
   
   ## Acceptance criteria
   - [ ] A fixture with queue delay, a plugin call and retried upstream 
attempts shares one finite budget; timeout settings cannot multiply the elapsed 
allowance.
   - [ ] Retry/backoff uses remaining time and stops on expiry or downstream 
cancellation. Connection acquisition and in-flight resource cleanup are 
verified on the actual supported clients.
   - [ ] Expiry before headers produces a documented result; expiry after 
commitment terminates according to the protocol without attempting to rewrite 
committed headers.
   - [ ] Monotonic timing, zero/invalid budgets, nested calls and unavailable 
propagation metadata have defined tests.
   - [ ] Metrics distinguish budget exhaustion from component timeout without 
request-ID/path label explosion.
   - [ ] Disabled mode remains compatible; document unsupported synchronous 
execution and stream semantics.
   
   Related: #7560 (WASM-specific enforcement), #7644 (bounded connection 
acquisition), #7650 (validation).
   


-- 
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