spec icon indicating copy to clipboard operation
spec copied to clipboard

HTTP: add ability to return early / skip future callbacks

Open mpwarres opened this issue 8 months ago • 3 comments

(This is somewhat related to #63, not sure if it's better to fold into that or keep as a separate issue)

ext_proc filter supports the notion of a processing mode override, in which an ext_proc ProcessingResponse for e.g. request headers can say: "skip future callbacks for this request", avoiding the cost of RPCs for request/response body.

For Proxy-Wasm, we might consider adding something analogous, for example a new proxy_action_t value indicating remaining non-lifecycle callbacks can be skipped, or allowing proxy_done to be called outside of proxy_on_done.

mpwarres avatar May 02 '25 14:05 mpwarres

I was mentally bundling this with #63 (see: Done), but it doesn't hurt to have an explicit issue for that. Thanks!

PiotrSikora avatar May 29 '25 14:05 PiotrSikora

Note that there are two related flavors of such a feature:

  1. Controlling future execution phases (a la mode_override, dynamic control over future events)
  2. Early return from the current phase (i.e. "I'm done", early return from streaming callbacks as in body processing)

In the proposal linked above, I'm not sure how EndStream and Done map to these concepts.

martijneken avatar Sep 22 '25 20:09 martijneken

EndStream is a request/response modification that adds end_stream flag that potentially wasn't there and finishes request or response (e.g. forwarding only HTTP headers upstream), but doesn't prevent future callbacks.

Done prevents future callbacks for given request/response, which isn't as elaborate as ext_proc's mode_override, but perhaps that's sufficient?

PiotrSikora avatar Sep 25 '25 15:09 PiotrSikora