-
Notifications
You must be signed in to change notification settings - Fork 73
Refactor around VM failure check on Http/Tcp callbacks. #155
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: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
OK now envoy test passes. |
Signed-off-by: Takeshi Yoneda <[email protected]>
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.
Thanks! Could you make sure that
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
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'm wondering if those pre-checks are even necessary? We catch all initialization failures in configuration phase, and all runtime failures should be caught by those new post-checks.
Am I missing something?
In any case, this is definitely an improvement, so feel free to merge as-is once Envoy tests pass.
Good point. For other stream contexts than the context where VM traps, the processing normally proceeds even after the VM failure. That's why we must have prechecks as well..? |
Oh yeah, good point. |
Fixes #14947 and properly closes streams. This commit differentiates `failStream` from `closeStream` where the former is called when a VM fails, and the latter is called via `close_stream` or `grpc_close` by user Wasm codes. Notably, we try to send local response with 503 for http streams as expected by the description of `fail_open` api. The change here is a little and mostly done in Proxy-Wasm C++ host implementation(proxy-wasm/proxy-wasm-cpp-host#155). Signed-off-by: Takeshi Yoneda <[email protected]>
Fixes envoyproxy#14947 and properly closes streams. This commit differentiates `failStream` from `closeStream` where the former is called when a VM fails, and the latter is called via `close_stream` or `grpc_close` by user Wasm codes. Notably, we try to send local response with 503 for http streams as expected by the description of `fail_open` api. The change here is a little and mostly done in Proxy-Wasm C++ host implementation(proxy-wasm/proxy-wasm-cpp-host#155). Signed-off-by: Takeshi Yoneda <[email protected]> Signed-off-by: Gokul Nair <[email protected]>
Relevant to envoyproxy/envoy#14947.
Refactored around VM failure check on Http and Tcp callbacks in order to handle the VM failure right after it happens. Previously, for example, when panic happens in OnResponseHeaders, then we return Continue since we didn't check the
isFail
after the Wasm calls. That means Envoy sends the response headers to the client even if the VM fails in OnResponseHeaders, and the failClose is called on OnResponseBody. This seems problematic and unintended.This is WIP since I haven't passed Envoy tests.Signed-off-by: Takeshi Yoneda [email protected]