-
Notifications
You must be signed in to change notification settings - Fork 70
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
Always process HTTP headers before processing HTTP body. #95
Conversation
Signed-off-by: Piotr Sikora <[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.
looks fine but I would like to know then why FilterHeadersStatus::StopIteration
exists?
one thing I can think of is other SDKs (TinyGo, Rust) has only two enum values (0, 1) and 1 corresponds to |
I honestly don't know why |
so we would better thinking about removing |
anyway, LGTM from me |
Yeah, but that's pending ABI update (proxy-wasm/spec#1). I'll work on finalizing that document once we fix the few outstanding bugs in Proxy-Wasm in Envoy. |
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.
This certainly fixes some problems that I've seen, but I wonder if we know enough about all the various use cases for this to be a good thing -- perhaps it's better to change this just in the Rust SDK, since the C++ SDK already supports all the return codes, and lots of existing Envoy filters do indeed use StopIteration.
cc @lizan |
verified that only a few existing native filters use |
@gbrail but this is not specific to Rust SDK. Notably, if you try to resume processing after returning
so any malicious Proxy-Wasm plugin could crash Envoy without this change. Also, I honestly don't understand why this flow exists in the first place. It's extremely error-prone, and the few Envoy filters that return |
Signed-off-by: Piotr Sikora <[email protected]>
Signed-off-by: Piotr Sikora <[email protected]>
Envoy now considers Should we add |
@PiotrSikora ^^ |
Yeah, Alternatively, if Envoy doesn't want to make this change, then we can track whether or not the local reply was sent and adjust the status as needed. cc @asraa |
There was some discussion about this in the PR: envoyproxy/envoy#14416 (comment) The condition we want to avoid is |
@asraa |
Generally, I am fine with loosening the condition to the minimal constraint. I can make a PR. Are people using debug builds? If so, that kind of defeats the purpose of these ENVOY_BUGs that aren't meant to crash users, but just inform them they might be doing something wrong. Unrelated, looking at the |
In Wasm, we only return I think there is a lot of value in |
Sounds good, I'll work on a PR to fix and try to reproduce ext_authz sending local reply and then stopall. Thanks for the info about WASM, in that case, the minimal constraint fits. It only results in crashes in debug mode though (in which case you are susceptible to faulty ASSERTs), do you think they should just be logging critical in debug mode too? |
Probably for next release or two... or at least make them non-crashing in the release branches, and leave crashes in |
in favor of #95, returns StopAllIterationAndWatermark to stop the further body processing in VM failure with fail_close cases. Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Piotr Sikora [email protected]