From 675b37a027b927979a929e5f658d804420b2205f Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Fri, 14 Jun 2019 14:57:14 -0700 Subject: [PATCH] Revert "interop-testing: Observe flow control in TestServiceImpl" This reverts commit e795f14bedc56af2f2ba60eef1b23add6106ab99. It breaks some of our internal tests. At the very least the cast fails because we are reusing the service for something without going through the normal stub. There may also have been a test hang, but it'd take more effort to figure out. --- .../grpc/testing/integration/TestServiceImpl.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java index 8d0c4f421a..5fe7248b2b 100644 --- a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java +++ b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java @@ -228,7 +228,7 @@ public class TestServiceImpl extends TestServiceGrpc.TestServiceImplBase { private class ResponseDispatcher { private final Chunk completionChunk = new Chunk(0, 0, 0); private final Queue chunks; - private final ServerCallStreamObserver responseStream; + private final StreamObserver responseStream; private boolean scheduled; @GuardedBy("this") private boolean cancelled; private Throwable failure; @@ -268,12 +268,7 @@ public class TestServiceImpl extends TestServiceGrpc.TestServiceImplBase { */ public ResponseDispatcher(StreamObserver responseStream) { this.chunks = Queues.newLinkedBlockingQueue(); - this.responseStream = (ServerCallStreamObserver) responseStream; - this.responseStream.setOnReadyHandler(new Runnable() { - @Override public void run() { - scheduleNextChunk(); - } - }); + this.responseStream = responseStream; } /** @@ -354,11 +349,6 @@ public class TestServiceImpl extends TestServiceGrpc.TestServiceImplBase { return; } - if (chunks.peek() != completionChunk && !responseStream.isReady()) { - // Wait for the onReady handler to be called. - return; - } - // Schedule the next response chunk if there is one. Chunk nextChunk = chunks.peek(); if (nextChunk != null) {