|
28 | 28 | import com.google.common.collect.ImmutableMap; |
29 | 29 | import com.google.common.io.BaseEncoding; |
30 | 30 | import com.google.common.io.ByteStreams; |
| 31 | +import com.google.common.util.concurrent.MoreExecutors; |
31 | 32 | import com.google.protobuf.ByteString; |
32 | 33 | import com.google.protobuf.UnsafeByteOperations; |
33 | 34 | import com.google.protobuf.Struct; |
@@ -134,7 +135,7 @@ public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall( |
134 | 135 | ScheduledExecutorService scheduler = SharedResourceHolder.get(GrpcUtil.TIMER_SERVICE); |
135 | 136 | ExternalProcessorGrpc.ExternalProcessorStub extProcStub = ExternalProcessorGrpc.newStub( |
136 | 137 | cachedChannelManager.getChannel(filterConfig.getGrpcServiceConfig())) |
137 | | - .withExecutor(com.google.common.util.concurrent.MoreExecutors.directExecutor()); |
| 138 | + .withExecutor(MoreExecutors.directExecutor()); |
138 | 139 |
|
139 | 140 | if (filterConfig.getGrpcServiceConfig().timeout().isPresent()) { |
140 | 141 | long timeoutNanos = filterConfig.getGrpcServiceConfig().timeout().get().toNanos(); |
@@ -350,7 +351,7 @@ protected DataPlaneServerCall( |
350 | 351 | Context callContext) { |
351 | 352 | super(rawCall); |
352 | 353 | this.rawCall = rawCall; |
353 | | - this.delegateExecutor = new SerializingExecutor(com.google.common.util.concurrent.MoreExecutors.directExecutor()); |
| 354 | + this.delegateExecutor = new SerializingExecutor(MoreExecutors.directExecutor()); |
354 | 355 | this.extProcStub = extProcStub.withExecutor(this.delegateExecutor); |
355 | 356 | this.config = config; |
356 | 357 | this.currentProcessingMode = config.getExternalProcessor().getProcessingMode(); |
@@ -1100,7 +1101,10 @@ private void checkEndOfStream(ProcessingResponse response) { |
1100 | 1101 | boolean terminal = false; |
1101 | 1102 | if (response.hasResponseTrailers()) { |
1102 | 1103 | terminal = true; |
1103 | | - } else if (response.hasResponseHeaders() && savedStatus != null) { |
| 1104 | + } else if (response.hasResponseHeaders() && savedStatus != null |
| 1105 | + && currentProcessingMode.getResponseBodyMode() == ProcessingMode.BodySendMode.NONE) { |
| 1106 | + terminal = true; |
| 1107 | + } else if (response.hasResponseBody() && responseSideClosed.get()) { |
1104 | 1108 | terminal = true; |
1105 | 1109 | } |
1106 | 1110 |
|
|
0 commit comments