Skip to content

Commit 79d2220

Browse files
committed
Remove unreachable statement checking for ext-proc stream state already closed when data plane onClose happens. Because the same serializing executor is used for both, and if ext-proc stream closed, the passthrough mode would have been set, this condition can never evaluate to true.
1 parent 3a7729f commit 79d2220

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

xds/src/main/java/io/grpc/xds/ExternalProcessorFilter.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,8 +1653,8 @@ public void onMessage(InputStream message) {
16531653
@Override
16541654
public void onClose(Status status, Metadata trailers) {
16551655
dataPlaneClientCall.serverTrailersStartNanos = System.nanoTime();
1656-
ExtProcStreamState state = dataPlaneClientCall.extProcStreamState.get();
1657-
if (state.isFailed()
1656+
ExtProcStreamState extProcStreamState = dataPlaneClientCall.extProcStreamState.get();
1657+
if (extProcStreamState.isFailed()
16581658
&& !dataPlaneClientCall.config.getFailureModeAllow()) {
16591659
if (dataPlaneClientCall.markDataPlaneCallClosed()) {
16601660
proceedWithClose(Status.UNAVAILABLE.withDescription("External processor stream failed")
@@ -1672,11 +1672,6 @@ public void onClose(Status status, Metadata trailers) {
16721672
this.savedStatus = status;
16731673
this.savedTrailers = trailers;
16741674

1675-
if (state.isCompleted()) {
1676-
proceedWithClose();
1677-
return;
1678-
}
1679-
16801675
if (savedHeaders != null) {
16811676
return;
16821677
}

0 commit comments

Comments
 (0)