Skip to content
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

ext_proc fuzzer test exposed a race issue which leads to ENVOY_BUG #27639

Merged
Merged
Changes from 1 commit
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
Next Next commit
ext_proc fuzzer test exposed a race issue which leads to ENVOY_BUG in…
… ext_proc filter when opens a gRPC stream.

Signed-off-by: Yanjun Xiang <[email protected]>
yanjunxiang-google committed May 25, 2023
commit f1f246e37bd4a06f24b081a3422c26783087ffed
11 changes: 6 additions & 5 deletions source/extensions/filters/http/ext_proc/ext_proc.cc
Original file line number Diff line number Diff line change
@@ -118,15 +118,16 @@ void Filter::setEncoderFilterCallbacks(Http::StreamEncoderFilterCallbacks& callb
}

Filter::StreamOpenState Filter::openStream() {
ENVOY_BUG(!processing_complete_, "openStream should not have been called");
// If processing already completes, no need to open a gRPC stream.
if (processing_complete_) {
// Stream failed while starting and either onGrpcError or onGrpcClose was already called
return sent_immediate_response_ ? StreamOpenState::Error : StreamOpenState::IgnoreError;
}
if (!stream_) {
ENVOY_LOG(debug, "Opening gRPC stream to external processor");
stream_ = client_->start(*this, grpc_service_, decoder_callbacks_->streamInfo());
stats_.streams_started_.inc();
if (processing_complete_) {
// Stream failed while starting and either onGrpcError or onGrpcClose was already called
return sent_immediate_response_ ? StreamOpenState::Error : StreamOpenState::IgnoreError;
}

// For custom access logging purposes. Applicable only for Envoy gRPC as Google gRPC does not
// have a proper implementation of streamInfo.
if (grpc_service_.has_envoy_grpc()) {

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.