GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Can the bundling behavior of gRPC be disabled for pubsub publishers? · Issue #1432 · googleapis/google-cloud-java

Can the bundling behavior of gRPC be disabled for pubsub publishers? #1432

New issue
Copy link
New issue
Copy link
Closed
Closed
Can the bundling behavior of gRPC be disabled for pubsub publishers?#1432
Copy link
Assignees
garrettjonesgoogle
Labels
api: pubsubIssues related to the Pub/Sub API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@mattnworb
mattnworb
opened on Nov 28, 2016
Issue body actions

I've encountered a case where an application that publishes pubsub messages (using google-cloud-pubsub:0.5.1) has encountered OutOfMemoryErrors which I have traced down to an instance of com.google.api.gax.bundling.ThresholdBundler taking up 92% of the heap space. This application purposefully runs with a small heap of ~256mb.

This application publishes all of it's messages to a single topic, so it seems as if all of the requests end up in the same ThresholdBundler instance. In the heap dump that I have, the ThresholdBundler instance has 63984 elements in the closedBundles list.

It looks like the gax library allows for the bundling behavior to be disabled via BundlingSettings$Builder.setIsEnabled(Boolean), but the pubsub layer does not expose any of these options and always leaves the bundling behavior as enabled.

Would it be possible to add flags to PubsubOptions (or wherever is appropriate) to allow for this request batching to be disabled if desired?

Activity

Next
  1. garrettjonesgoogle commented on Nov 29, 2016

    @garrettjonesgoogle
    garrettjonesgoogle
    on Nov 29, 2016
    Contributor
    More actions

    This is very unusual - the 63k elements is far beyond the limit set in the bundler; that amount of elements should have triggered a publish. The default limits are 1000 elements, 10 ms, and 10 mb; surpassing any individual limit should trigger a publish.

    Are you publishing synchronously or asynchronously?

    I think it makes sense to expose the controls - we are already working on a design that will do that.

  2. mattnworb commented on Nov 29, 2016

    @mattnworb
    mattnworb
    on Nov 29, 2016
    Author
    More actions

    Hey Garret, we are publishing asynchronously, in a fire-and-forget manner. Our code adds a listener to the returned future to log if it succeeded or failed but we otherwise don't handle the response in any way. Each of our publish requests contains one message.

    I think I forgot to mention earlier that we are using all of the default settings with the client.

    Is there any state in particular of the ThresholdBundler or other pubsub-related instances that would be good to know about? Since I have a heap dump of an affected host I can examine anything that might seem relevant for the unexpected Bundler behavior.

  3. davidxia commented on Nov 29, 2016

    @davidxia
    davidxia
    on Nov 29, 2016
    Contributor
    More actions

    Hi, @garrettjonesgoogle. I see the code for those limits you're talking about. These seem to be settings for each individual bundle and not the ThresholdBundler itself. I think @mattnworb is saying 63K is the number of closedBundles not the number of elements in each bundle.

    Is the ThresholdBundler.closedBundles array bounded in any way?

    Speculation: What if some exception happens in ThresholdBundlingForwarder here before the bundle can be drained here? Or what if closedBundles is added to more quickly than the other thread can drain it?

    Could this cause our OOM?

  4. garrettjonesgoogle commented on Nov 29, 2016

    @garrettjonesgoogle
    garrettjonesgoogle
    on Nov 29, 2016
    Contributor
    More actions

    Ahh yes you're right - there is no limit on closedBundles. Both explanations (draining isn't fast enough, draining is failing) make sense for an OOM. If the runnable exits (e.g. due to an exception), there isn't currently anything that will restart it, which is a flaw. Do you have any trace of an exception that happened?

  5. garrettjonesgoogle
    added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Nov 29, 2016
  6. davidxia commented on Nov 29, 2016

    @davidxia
    davidxia
    on Nov 29, 2016
    Contributor
    More actions

    @garrettjonesgoogle, this is a stacktrace where BundleExecutor.processBundle() throws a RuntimeException. This is from a machine that became OOM. I don't know if this stackstrace is the actual cause of the OOM, but it seems likely?

    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]: Unable to send an event to Google PubSub, topic: com.spotify.tingle.helios-events.HeliosTaskStatusEvents
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    com.google.cloud.pubsub.PubSubException: io.grpc.StatusRuntimeException: UNAUTHENTICATED
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at com.google.cloud.pubsub.spi.DefaultPubSubRpc$1.apply(DefaultPubSubRpc.java:179)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at com.google.cloud.pubsub.spi.DefaultPubSubRpc$1.apply(DefaultPubSubRpc.java:173)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at com.google.common.util.concurrent.Futures$CatchingFuture.doFallback(Futures.java:842)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at com.google.common.util.concurrent.Futures$CatchingFuture.doFallback(Futures.java:834)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at com.google.common.util.concurrent.Futures$AbstractCatchingFuture.run(Futures.java:789)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:456)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:817)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:753)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:634)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at com.google.common.util.concurrent.SettableFuture.setException(SettableFuture.java:53)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at com.google.api.gax.grpc.BundlingFuture.setException(BundlingFuture.java:118)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at com.google.api.gax.grpc.BundlingContext.sendResult(BundlingContext.java:99)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at com.google.api.gax.grpc.BundleExecutor.processBundle(BundleExecutor.java:91)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at com.google.api.gax.bundling.ThresholdBundlingForwarder$BundleForwardingRunnable.processBundle(ThresholdBundlingForwarder.java:110)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at com.google.api.gax.bundling.ThresholdBundlingForwarder$BundleForwardingRunnable.run(ThresholdBundlingForwarder.java:93)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    at java.lang.Thread.run(Thread.java:745)
    2016-11-10T18:50:44.418+00:00 my.host.com helios[2831]:    Caused by: com.google.api.gax.grpc.ApiException: io.grpc.StatusRuntimeException: UNAUTHENTICATED
    

    Let me know if this helps and/or if you need more info.

  7. garrettjonesgoogle commented on Nov 29, 2016

    @garrettjonesgoogle
    garrettjonesgoogle
    on Nov 29, 2016
    Contributor
    More actions

    So have you been able to successfully send any messages? UNAUTHENTICATED implies that you haven't - or another scenario might be that you authenticated once, but for some reason the authentication expired.

  8. davidxia commented on Nov 29, 2016

    @davidxia
    davidxia
    on Nov 29, 2016
    Contributor
    More actions

    @garrettjonesgoogle I think we have been, but isn't the unauthenticated part an orthogonal issue?

  9. garrettjonesgoogle commented on Nov 29, 2016

    @garrettjonesgoogle
    garrettjonesgoogle
    on Nov 29, 2016
    Contributor
    More actions

    Yes it is, but it might be a secondary issue that also needs to be addressed - if authentication expires, it needs to be refreshed somehow.

  10. davidxia commented on Nov 29, 2016

    @davidxia
    davidxia
    on Nov 29, 2016
    Contributor
    More actions

    Gotcha. I've attached the full stack trace here.
    pubsub_oom_stracktrace.txt

  11. garrettjonesgoogle commented on Nov 29, 2016

    @garrettjonesgoogle
    garrettjonesgoogle
    on Nov 29, 2016
    Contributor
    More actions

    The thing I'm curious about is what type of credentials you are using. Are you using the default credentials (which use Application Default Credentials under the hood), or something else?

  12. davidxia commented on Nov 29, 2016

    @davidxia
    davidxia
    on Nov 29, 2016
    Contributor
    More actions

    I think default? @mattnworb will have more details.

  13. lndbrg commented on Nov 30, 2016

    @lndbrg
    lndbrg
    on Nov 30, 2016
    More actions

    we are injecting a path to a credentials file from GOOGLE_APPLICATION_CREDENTIALS environment variable.

    (we use a version of the library before it moved to google-auth-library-java, so it follows this pattern:

    1. Credentials supplied when building the service options
    2. App Engine credentials
    3. Key file pointed to by the GOOGLE_APPLICATION_CREDENTIALS environment variable
    4. Google Cloud SDK credentials
    5. Compute Engine credentials)

    It's verified to pick up the correct credentials and being able to use them without auth issues on other instances and services (and seems to have no problem re-authing after having seen UNAUTHENTICATED in the logs).

  14. mattnworb commented on Nov 30, 2016

    @mattnworb
    mattnworb
    on Nov 30, 2016
    Author
    More actions

    To verify what @lndbrg mentioned we are using a service account with the credentials supplied as he mentioned.

    Our publisher application runs on 1000s of hosts and we have seen this problem with the OutOfMemoryError on just a handful of hosts.

    Looking at the logs of one of the affected host, it seems like it begins to get publishing errors almost immediately after startup due to an inability to connect to get an access token for the service account:

    Unable to send an event to Google PubSub, topic: <the-topic-name>
      com.google.cloud.pubsub.PubSubException: io.grpc.StatusRuntimeException: UNAUTHENTICATED
      at com.google.cloud.pubsub.spi.DefaultPubSubRpc$1.apply(DefaultPubSubRpc.java:179)
      at com.google.cloud.pubsub.spi.DefaultPubSubRpc$1.apply(DefaultPubSubRpc.java:173)
      at com.google.common.util.concurrent.Futures$CatchingFuture.doFallback(Futures.java:842)
      at com.google.common.util.concurrent.Futures$CatchingFuture.doFallback(Futures.java:834)
      at com.google.common.util.concurrent.Futures$AbstractCatchingFuture.run(Futures.java:789)
      at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:456)
      at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:817)
      at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:753)
      at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:634)
      at com.google.common.util.concurrent.SettableFuture.setException(SettableFuture.java:53)
      at com.google.api.gax.grpc.BundlingFuture.setException(BundlingFuture.java:118)
      at com.google.api.gax.grpc.BundlingContext.sendResult(BundlingContext.java:99)
      at com.google.api.gax.grpc.BundleExecutor.processBundle(BundleExecutor.java:91)
      at com.google.api.gax.bundling.ThresholdBundlingForwarder$BundleForwardingRunnable.processBundle(ThresholdBundlingForwarder.java:110)
      at com.google.api.gax.bundling.ThresholdBundlingForwarder$BundleForwardingRunnable.run(ThresholdBundlingForwarder.java:93)
      at java.lang.Thread.run(Thread.java:745)
    Caused by: com.google.api.gax.grpc.ApiException: io.grpc.StatusRuntimeException: UNAUTHENTICATED
      at com.google.api.gax.grpc.ExceptionTransformingCallable$ExceptionTransformingFuture.onFailure(ExceptionTransformingCallable.java:113)
      at com.google.common.util.concurrent.Futures$6.run(Futures.java:1764)
      at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:456)
      at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:817)
      at com.google.common.util.concurrent.AbstractFuture.addListener(AbstractFuture.java:595)
      at com.google.common.util.concurrent.Futures.addCallback(Futures.java:1776)
      at com.google.common.util.concurrent.Futures.addCallback(Futures.java:1713)
      at com.google.api.gax.grpc.ExceptionTransformingCallable.futureCall(ExceptionTransformingCallable.java:69)
      at com.google.api.gax.grpc.RetryingCallable$RetryingResultFuture.issueCall(RetryingCallable.java:222)
      at com.google.api.gax.grpc.RetryingCallable.futureCall(RetryingCallable.java:90)
      at com.google.api.gax.grpc.UnaryCallable.futureCall(UnaryCallable.java:242)
      at com.google.api.gax.grpc.UnaryCallable.futureCall(UnaryCallable.java:253)
      at com.google.api.gax.grpc.UnaryCallable.call(UnaryCallable.java:290)
      at com.google.api.gax.grpc.BundleExecutor.processBundle(BundleExecutor.java:84)
      at com.google.api.gax.bundling.ThresholdBundlingForwarder$BundleForwardingRunnable.processBundle(ThresholdBundlingForwarder.java:110)
      at com.google.api.gax.bundling.ThresholdBundlingForwarder$BundleForwardingRunnable.run(ThresholdBundlingForwarder.java:93)
      at java.lang.Thread.run(Thread.java:745)
    Caused by: io.grpc.StatusRuntimeException: UNAUTHENTICATED
      at io.grpc.Status.asRuntimeException(Status.java:545)
      at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:442)
      at io.grpc.ClientInterceptors$CheckedForwardingClientCall.start(ClientInterceptors.java:203)
      at io.grpc.ForwardingClientCall.start(ForwardingClientCall.java:47)
      at com.google.api.gax.grpc.HeaderInterceptor$1.start(HeaderInterceptor.java:64)
      at io.grpc.stub.ClientCalls.startCall(ClientCalls.java:273)
      at io.grpc.stub.ClientCalls.asyncUnaryRequestCall(ClientCalls.java:252)
      at io.grpc.stub.ClientCalls.futureUnaryCall(ClientCalls.java:189)
      at com.google.api.gax.grpc.DirectCallable.futureCall(DirectCallable.java:58)
      at com.google.api.gax.grpc.ExceptionTransformingCallable.futureCall(ExceptionTransformingCallable.java:66)
      at com.google.api.gax.grpc.RetryingCallable$RetryingResultFuture.issueCall(RetryingCallable.java:222)
      at com.google.api.gax.grpc.RetryingCallable.futureCall(RetryingCallable.java:90)
      at com.google.api.gax.grpc.UnaryCallable.futureCall(UnaryCallable.java:242)
      at com.google.api.gax.grpc.UnaryCallable.futureCall(UnaryCallable.java:253)
      at com.google.api.gax.grpc.UnaryCallable.call(UnaryCallable.java:290)
      at com.google.api.gax.grpc.BundleExecutor.processBundle(BundleExecutor.java:84)
      at com.google.api.gax.bundling.ThresholdBundlingForwarder$BundleForwardingRunnable.processBundle(ThresholdBundlingForwarder.java:110)
      at com.google.api.gax.bundling.ThresholdBundlingForwarder$BundleForwardingRunnable.run(ThresholdBundlingForwarder.java:93)
      at java.lang.Thread.run(Thread.java:745)
    Caused by: java.io.IOException: Error getting access token for service account: 
      at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:227)
      at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:97)
      at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:74)
      at io.grpc.auth.ClientAuthInterceptor.getRequestMetadata(ClientAuthInterceptor.java:150)
      at io.grpc.auth.ClientAuthInterceptor.access$100(ClientAuthInterceptor.java:64)
      at io.grpc.auth.ClientAuthInterceptor$1.checkedStart(ClientAuthInterceptor.java:96)
      at io.grpc.ClientInterceptors$CheckedForwardingClientCall.start(ClientInterceptors.java:195)
      at io.grpc.ForwardingClientCall.start(ForwardingClientCall.java:47)
      at com.google.api.gax.grpc.HeaderInterceptor$1.start(HeaderInterceptor.java:64)
      at io.grpc.stub.ClientCalls.startCall(ClientCalls.java:273)
      at io.grpc.stub.ClientCalls.asyncUnaryRequestCall(ClientCalls.java:252)
      at io.grpc.stub.ClientCalls.futureUnaryCall(ClientCalls.java:189)
      at com.google.api.gax.grpc.DirectCallable.futureCall(DirectCallable.java:58)
      at com.google.api.gax.grpc.ExceptionTransformingCallable.futureCall(ExceptionTransformingCallable.java:66)
      at com.google.api.gax.grpc.RetryingCallable$RetryingResultFuture.issueCall(RetryingCallable.java:222)
      at com.google.api.gax.grpc.RetryingCallable.futureCall(RetryingCallable.java:90)
      at com.google.api.gax.grpc.UnaryCallable.futureCall(UnaryCallable.java:242)
      at com.google.api.gax.grpc.UnaryCallable.futureCall(UnaryCallable.java:253)
      at com.google.api.gax.grpc.UnaryCallable.call(UnaryCallable.java:290)
      at com.google.api.gax.grpc.BundleExecutor.processBundle(BundleExecutor.java:84)
      at com.google.api.gax.bundling.ThresholdBundlingForwarder$BundleForwardingRunnable.processBundle(ThresholdBundlingForwarder.java:110)
      at com.google.api.gax.bundling.ThresholdBundlingForwarder$BundleForwardingRunnable.run(ThresholdBundlingForwarder.java:93)
      at java.lang.Thread.run(Thread.java:745)
    Caused by: java.net.SocketTimeoutException: connect timed out
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
      at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
      at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      at java.net.Socket.connect(Socket.java:589)
      at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668)
      at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
      at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
      at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
      at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
      at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
      at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
      at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1104)
      at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:998)
      at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1282)
      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1257)
      at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
      at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:77)
      at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:972)
      at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:225)
      at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:97)
      at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:74)
      at io.grpc.auth.ClientAuthInterceptor.getRequestMetadata(ClientAuthInterceptor.java:150)
      at io.grpc.auth.ClientAuthInterceptor.access$100(ClientAuthInterceptor.java:64)
      at io.grpc.auth.ClientAuthInterceptor$1.checkedStart(ClientAuthInterceptor.java:96)
      at io.grpc.ClientInterceptors$CheckedForwardingClientCall.start(ClientInterceptors.java:195)
      at io.grpc.ForwardingClientCall.start(ForwardingClientCall.java:47)
      at com.google.api.gax.grpc.HeaderInterceptor$1.start(HeaderInterceptor.java:64)
      at io.grpc.stub.ClientCalls.startCall(ClientCalls.java:273)
      at io.grpc.stub.ClientCalls.asyncUnaryRequestCall(ClientCalls.java:252)
      at io.grpc.stub.ClientCalls.futureUnaryCall(ClientCalls.java:189)
      at com.google.api.gax.grpc.DirectCallable.futureCall(DirectCallable.java:58)
      at com.google.api.gax.grpc.ExceptionTransformingCallable.futureCall(ExceptionTransformingCallable.java:66)
      at com.google.api.gax.grpc.RetryingCallable$RetryingResultFuture.issueCall(RetryingCallable.java:222)
      at com.google.api.gax.grpc.RetryingCallable.futureCall(RetryingCallable.java:90)
      at com.google.api.gax.grpc.UnaryCallable.futureCall(UnaryCallable.java:242)
      at com.google.api.gax.grpc.UnaryCallable.futureCall(UnaryCallable.java:253)
      at com.google.api.gax.grpc.UnaryCallable.call(UnaryCallable.java:290)
      at com.google.api.gax.grpc.BundleExecutor.processBundle(BundleExecutor.java:84)
      at com.google.api.gax.bundling.ThresholdBundlingForwarder$BundleForwardingRunnable.processBundle(ThresholdBundlingForwarder.java:110)
      at com.google.api.gax.bundling.ThresholdBundlingForwarder$BundleForwardingRunnable.run(ThresholdBundlingForwarder.java:93)
      at java.lang.Thread.run(Thread.java:745)
    

    The root of the exception originates in com.google.api.gax.bundling.ThresholdBundlingForwarder$BundleForwardingRunnable.run(ThresholdBundlingForwarder.java:93) as pointed out earlier.

    The application is then attempting to publish new messages every 10-20 seconds, and this stacktrace repeats for each attempt (so it seems as if the thread launched by ThresholdBundlingForwarder is not dying, or is being restarted). This continues for 8 days or so until we see an OutOfMemoryError.

    Instances of the application that don't have issues connecting to the relevant googleapi to get an access token don't experience any issues publishing and never receive an OOM.

    So I think there are three issues going on:

    1. com.google.api.gax.bundling.ThresholdBundler has an unbounded queue for closedBundles that will fill endlessly if an application is publishing faster than the queue can be drained, or if draining/publishing can't occur at all for some reason.

    2. It seems like if the thread that ThresholdBundlingForwarder starts dies for any reason, it won't be restarted, and the messages accumulating in the Bundler will not be processed at all; however, I do not believe that we are seeing this in our own application as the stacktrace seems to propogate from com.google.api.gax.grpc.BundleExecutor.processBundle(BundleExecutor.java:91) - the exception that masquerades as UNAUTHENTICATED is caught here when the callable is invoked.

    3. The google-cloud-pubsub library doesn't provide any way to configure the bundling behavior within the gax/grpc layers via PubSub or PubSubOptions. If this existed, then we could simply disable bundling in our application (as we are not publishing very many messages in the normal use case) to sidestep 1 and 2 above for now.

    Since 1 and 2 are really issues within the googleapis/gax-java library, should we open issues there instead?

    I believe @davidxia also opened an issue in the Cloud Support Center - we'd be happy to continue the discussion there (or here), whichever seems best for resolving this.

  15. garrettjonesgoogle commented on Nov 30, 2016

    @garrettjonesgoogle
    garrettjonesgoogle
    on Nov 30, 2016
    Contributor
    More actions

    Filing issues 1 & 2 against gax-java makes sense. (The same people work on both repositories.)

    One potential way to mitigate failing hosts in your case is to send 1 synchronous "canary" call when the app starts; if it gets UNAUTHENTICATED, then you can recover & fix that then, instead of having the host do nothing useful and eventually OOM. Potentially it doesn't even have to be a publish call - calling getTopic() is probably sufficient to establish that the authentication worked.

    We'll try to get all of these other issues fixed, but be aware that we are currently resource-constrained.

  16. 23 remaining items

  17. mattnworb commented on Mar 3, 2017

    @mattnworb
    mattnworb
    on Mar 3, 2017
    Author
    More actions

    @garrettjonesgoogle I haven't had a chance to try out the new Publisher yet, but thanks overall for following up on this and addressing the issue.

  18. theacodes
    unassigned
    pongad
    on Sep 28, 2018
  19. JustinBeckwith
    assigned
    garrettjonesgoogle
    on Feb 1, 2021
  20. github-actions
    added 2 commits that reference this issue on Aug 9, 2022

    deps: update dependency com.google.cloud:google-cloud-pubsub to v1.12…

    4ab39e9

    chore(main): release 2.3.3 (#1437)

    3733745
  21. github-actions
    added a commit that references this issue on Nov 19, 2022

    chore(java): add a note in README for migrated split repos (googleapi…

    453ea03
  22. meltsufin
    added a commit that references this issue on Dec 22, 2025

    build(deps): update dependency org.apache.maven.plugins:maven-javadoc…

    a13dbbd
  23. chingor13
    added a commit that references this issue on Jan 6, 2026

    deps: update dependency io.opentelemetry:opentelemetry-api to v1.47.0 (…

    4041f04
  24. chingor13
    added a commit that references this issue on Jan 22, 2026

    chore(main): release 2.19.3-SNAPSHOT (#1432)

    beb8d0d
  25. suztomo
    added a commit that references this issue on Mar 11, 2026

    build(deps): update dependency org.apache.maven.plugins:maven-javadoc…

    2e71fb0
  26. suztomo
    added a commit that references this issue on Mar 23, 2026

    chore(deps): update dependency com.google.cloud:google-cloud-spanner-…

    5c832aa
  27. suztomo
    added a commit that references this issue on Mar 30, 2026

    chore(deps): update dependency com.google.cloud:google-cloud-nio to v…

    f7519eb
  28. lqiu96
    added a commit that references this issue on Apr 1, 2026

    chore(deps): update dependency com.google.cloud:google-cloud-nio to v…

    ad1f426
  29. meltsufin
    added 2 commits that reference this issue on Apr 29, 2026

    chore(main): release 1.122.2-SNAPSHOT (#1432)

    b31864a

    chore(main): release 1.122.2-SNAPSHOT (#1432)

    2f0d254
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @garrettjonesgoogle
    garrettjonesgoogle

Labels

api: pubsubIssues related to the Pub/Sub API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.