Hello, I am having issues with fetching data from the Google Ads API. When retrieving ~17000 GoogleAdsRows, the first 10000 rows are available and used during the first iterator.next(), but for the subsequent 7000 rows the search stream is already closed, but iterator.next() tries to create another request to the closed stream. This throws an error (shown below) because the stream is already closed. The 7000 rows already seem to be in the buffer so I'm not sure why it tries to request them from the closed stream again.
The API docs show (and I followed) the usage of the ServerStream inside a double for loop:
for (SearchGoogleAdsStreamResponse page : stream)
for (GoogleAdsRow : page.getResultsList())
... processing ...
The error message is:
javax.servlet.ServletException: java.util.concurrent.RejectedExecutionException: event executor terminated
Caused by: java.util.concurrent.RejectedExecutionException: event executor terminated
at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:926)
at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.offerTask(SingleThreadEventExecutor.java:353)
at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:346)
at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:828)
at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:818)
at io.grpc.netty.shaded.io.grpc.netty.NettyClientStream$TransportState.runOnTransportThread(NettyClientStream.java:314)
at io.grpc.internal.AbstractStream$TransportState.requestMessagesFromDeframer(AbstractStream.java:248)
at io.grpc.internal.AbstractStream$TransportState.access$000(AbstractStream.java:114)
at io.grpc.internal.AbstractStream.request(AbstractStream.java:57)
at io.grpc.internal.DelayedStream.request(DelayedStream.java:358)
at io.grpc.internal.ForwardingClientStream.request(ForwardingClientStream.java:32)
at io.grpc.internal.DelayedStream.request(DelayedStream.java:358)
at io.grpc.internal.RetriableStream.request(RetriableStream.java:560)
at io.grpc.internal.ClientCallImpl.request(ClientCallImpl.java:437)
at io.grpc.internal.DelayedClientCall.request(DelayedClientCall.java:344)
at io.grpc.PartialForwardingClientCall.request(PartialForwardingClientCall.java:34)
at io.grpc.ForwardingClientCall.request(ForwardingClientCall.java:22)
at io.grpc.ForwardingClientCall$SimpleForwardingClientCall.request(ForwardingClientCall.java:44)
at io.grpc.PartialForwardingClientCall.request(PartialForwardingClientCall.java:34)
at io.grpc.ForwardingClientCall.request(ForwardingClientCall.java:22)
at io.grpc.ForwardingClientCall$SimpleForwardingClientCall.request(ForwardingClientCall.java:44)
at com.google.api.gax.grpc.GrpcDirectStreamController.request(GrpcDirectStreamController.java:96)
at com.google.api.gax.grpc.ExceptionResponseObserver$1.request(ExceptionResponseObserver.java:67)
at com.google.api.gax.rpc.Watchdog$WatchdogStream.onRequest(Watchdog.java:249)
at com.google.api.gax.rpc.Watchdog$WatchdogStream.access$400(Watchdog.java:177)
at com.google.api.gax.rpc.Watchdog$WatchdogStream$1.request(Watchdog.java:221)
at com.google.api.gax.rpc.ServerStreamingAttemptCallable.onRequest(ServerStreamingAttemptCallable.java:345)
at com.google.api.gax.rpc.ServerStreamingAttemptCallable.access$200(ServerStreamingAttemptCallable.java:97)
at com.google.api.gax.rpc.ServerStreamingAttemptCallable$1.request(ServerStreamingAttemptCallable.java:168)
at com.google.api.gax.tracing.TracedResponseObserver$1.request(TracedResponseObserver.java:82)
at com.google.api.gax.rpc.QueuingResponseObserver.request(QueuingResponseObserver.java:63)
at com.google.api.gax.rpc.ServerStreamIterator.next(ServerStreamIterator.java:75)