Skip to content

Commit

Permalink
adding stream_ check
Browse files Browse the repository at this point in the history
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
  • Loading branch information
yanjunxiang-google committed May 31, 2023
1 parent 0ebd8c7 commit 3bfe644
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/extensions/filters/http/ext_proc/ext_proc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,16 @@ void Filter::setEncoderFilterCallbacks(Http::StreamEncoderFilterCallbacks& callb
Filter::StreamOpenState Filter::openStream() {
// 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 (stream_ == nullptr) {
return config_->failureModeAllow() ? StreamOpenState::IgnoreError : StreamOpenState::Error;
}

stats_.streams_started_.inc();
// 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

0 comments on commit 3bfe644

Please sign in to comment.