Skip to content

Commit

Permalink
addressing comments
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 3bfe644 commit 7e3f10b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/extensions/filters/http/ext_proc/ext_proc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,18 @@ void Filter::setEncoderFilterCallbacks(Http::StreamEncoderFilterCallbacks& callb
}

Filter::StreamOpenState Filter::openStream() {
// If processing already completes, no need to open a gRPC stream.
// External processing already completes. Return IgnoreError so the filter will return Continue.
if (processing_complete_) {
return sent_immediate_response_ ? StreamOpenState::Error : StreamOpenState::IgnoreError;
return StreamOpenState::IgnoreError;
}
if (!stream_) {
ENVOY_LOG(debug, "Opening gRPC stream to external processor");
stream_ = client_->start(*this, grpc_service_, decoder_callbacks_->streamInfo());
if (stream_ == nullptr) {
return config_->failureModeAllow() ? StreamOpenState::IgnoreError : StreamOpenState::Error;
}

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()) {
Expand Down

0 comments on commit 7e3f10b

Please sign in to comment.