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
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
Expand Up @@ -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_) {
yanjunxiang-google marked this conversation as resolved.
Show resolved Hide resolved
// 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;
}

yanjunxiang-google marked this conversation as resolved.
Show resolved Hide resolved
// 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()) {
Expand Down

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