Search Stream - Java issue

97 views
Skip to first unread message

Angelo Veres

unread,
Aug 30, 2022, 2:18:29 PM8/30/22
to Google Ads API and AdWords API Forum
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)

Google Ads API Forum Advisor

unread,
Aug 30, 2022, 9:19:28 PM8/30/22
to angelo...@eulerity.com, adwor...@googlegroups.com

Hi Angelo,


Thanks for reaching out to the Google Ads API team. I hope you are doing well today.
 

To investigate the issue further, could you please provide the complete request and response logs, with the request-id? If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.
 

You can provide it via Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.
 

Regards,

Google Logo
Darwin
Google Ads API Team
 


ref:_00D1U1174p._5004Q2dtTpd:ref
Reply all
Reply to author
Forward
0 new messages