Skip to content

Fix sengind local replies after VM failure in decodeHeaders callback. #432

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,11 @@ FilterMetadataStatus ContextBase::onRequestMetadata(uint32_t elements) {
}

FilterHeadersStatus ContextBase::onResponseHeaders(uint32_t headers, bool end_of_stream) {
CHECK_FAIL_HTTP(FilterHeadersStatus::Continue, FilterHeadersStatus::StopAllIterationAndWatermark);
// This callback may be called when WASM encountered fatal failure on earlier
// stages of request processing. In that case we are may be in process of
// sending local reply due to failStream() call.
// We must not block it to prevent request hang.
CHECK_FAIL_HTTP(FilterHeadersStatus::Continue, FilterHeadersStatus::Continue);
if (!wasm_->on_response_headers_abi_01_ && !wasm_->on_response_headers_abi_02_) {
return FilterHeadersStatus::Continue;
}
Expand Down