-
Notifications
You must be signed in to change notification settings - Fork 70
Add support for closing of connections in the ABI/SDK. #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: John Plevyak <[email protected]>
proxy_wasm_api.h
Outdated
inline WasmResult continueResponse() { return proxy_continue_stream(WasmStreamType::Response); } | ||
|
||
inline WasmResult closeRequest() { return proxy_close_stream(WasmStreamType::Request); } | ||
inline WasmResult closeResponse() { return proxy_continue_stream(WasmStreamType::Response); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
close_stream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanx! fixed.
Signed-off-by: John Plevyak <[email protected]>
inline WasmResult continueResponse() { return proxy_continue_stream(WasmStreamType::Response); } | ||
|
||
inline WasmResult closeRequest() { return proxy_close_stream(WasmStreamType::Request); } | ||
inline WasmResult closeResponse() { return proxy_close_stream(WasmStreamType::Response); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think close
should be exposed only for network filters.
We generally don't expose underlying connection in HTTP (at least not yet), and there is no concept of closing request separately from closing response (unless we start doing retries within Proxy-Wasm, but that's not there yet). Also, we already have send_local_response
, which effectively terminates HTTP request/response flow, and seems like much more elegant way to terminate HTTP request/response than hard close (e.g. there would be response code and details in the logs).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the case where you are tunneling another protocol through say HTTP CONNECT or POST and there is a error in the inner protocol? Do we want to jam an HTTP response in the middle of the request? Is that legal for CONNECT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tunneling via HTTP/2 CONNECT is going to be handed off to normal network filters, not HTTP filters, so it won't be handled as HTTP request/response in Proxy-Wasm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, I like the idea of being able to just shut something down, even if we are in the middle of say tunneling the response.
Ping. |
Signed-off-by: John Plevyak [email protected]