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 — ResourceExhaustedException · Issue #3343 · googleapis/google-cloud-java

ResourceExhaustedException  #3343

New issue
Copy link
New issue
Copy link
Closed
Closed
ResourceExhaustedException #3343
Copy link
Assignees
andreamlin
Labels
api: monitoringIssues related to the Cloud Monitoring API.type: questionRequest for information or clarification. Not an issue.

Description

@SachithW
SachithW
opened on Jun 5, 2018
Issue body actions

Hello,

I am reading a pubsub subscription queue length and publish rate continuously using a Timer. But I am getting this exception time to time.

Exception in thread "Timer-0" com.google.api.gax.rpc.ResourceExhaustedException: io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: The query rate is too high. at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:57) at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72) at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60) at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:95) at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:61) at com.google.common.util.concurrent.Futures$4.run(Futures.java:1123) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:435) at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:900) at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:811) at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:675) at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:492) at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:467) at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:41) at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:684) at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:41) at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:392) at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:475) at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:557) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:478) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:590) at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: The query rate is too high. at io.grpc.Status.asRuntimeException(Status.java:526) ... 19 more

my code is as follows.

   final MetricServiceClient client = MetricServiceClient.create();
            ProjectName name = ProjectName.of(projectId);    
             long startMillis = System.currentTimeMillis() - ((60 * 1) * 1000);
             TimeInterval interval = TimeInterval.newBuilder()
                .setStartTime(Timestamps.fromMillis(startMillis))
                .setEndTime(Timestamps.fromMillis(System.currentTimeMillis()))
                .build(); 



        Aggregation aggregation = Aggregation.newBuilder()
                .setAlignmentPeriod(Duration.newBuilder().setSeconds(300).build())
                .setPerSeriesAligner(Aggregation.Aligner.ALIGN_MEAN)
                .build();

        ListTimeSeriesRequest.Builder requestBuilder1 = ListTimeSeriesRequest.newBuilder()
                .setName(name.toString())
                .setFilter(filter1)
                .setInterval(interval);
        ListTimeSeriesRequest request1 = requestBuilder1.build();
        MetricServiceClient.ListTimeSeriesPagedResponse response1 = client.listTimeSeries(request1);

Activity

  1. andreamlin commented on Jun 5, 2018

    @andreamlin
    andreamlin
    on Jun 5, 2018
    Contributor
    More actions

    The MetricServiceClient is part of the Monitoring API, which is subject to request both daily quotas and QPS quotas (see https://developers.google.com/analytics/devguides/reporting/core/v3/limits-quotas for details). It is likely that requests are made too often through your project or your IP address.

  2. andreamlin
    self-assigned this
    on Jun 5, 2018
  3. SachithW commented on Jun 6, 2018

    @SachithW
    SachithW
    on Jun 6, 2018
    Author
    More actions

    According to the API dashboard my requests/sec is always under 8 requests/sec. And in my project
    Requests per day quota is set to unlimited. Anyway I will further reduces the timer frequency and let you know.

    By the way with the above exception there is another exception throws.

    Exception in thread "Timer-2" com.google.api.gax.rpc.InternalException: io.grpc.StatusRuntimeException: INTERNAL: An internal error occurred.
    at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:67)
    at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72)
    at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60)
    at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:95)
    at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:61)
    at com.google.common.util.concurrent.Futures$4.run(Futures.java:1123)
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:435)
    at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:900)
    at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:811)
    at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:675)
    at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:492)
    at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:467)
    at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:41)
    at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:684)
    at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:41)
    at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:391)
    at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:475)
    at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:557)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:478)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:590)
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
    at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
    Caused by: io.grpc.StatusRuntimeException: INTERNAL: An internal error occurred.
    at io.grpc.Status.asRuntimeException(Status.java:526)
    ... 19 more

  4. andreamlin commented on Jun 6, 2018

    @andreamlin
    andreamlin
    on Jun 6, 2018
    Contributor
    More actions

    Is the INTERNAL error intermittent also? Does it only happen when the RESOURCE_EXHAUSTED error is also thrown?

  5. SachithW commented on Jun 7, 2018

    @SachithW
    SachithW
    on Jun 7, 2018 via email
    Author
    More actions
    Can't say exactly. some times this internal error happens separately.
    …
    On Thu, 7 Jun 2018, 00:37 Andrea Lin, ***@***.***> wrote: Is the INTERNAL error intermittent also? Does it only happen when the RESOURCE_EXHAUSTED error is also thrown? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#3343 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AKiF7kSYbLMnYfLT7Z1U_WH9GSA7tZIFks5t6CiEgaJpZM4UaHlE> .
  6. JustinBeckwith
    added
    🚨 criticalP0 critical issue. Requires immediate fix
    triage meI really want to be triaged.
    and removed
    🚨 criticalP0 critical issue. Requires immediate fix
    on Jun 8, 2018
  7. yihanzhen
    added
    type: questionRequest for information or clarification. Not an issue.
    api: pubsubIssues related to the Pub/Sub API.
    priority: p2Moderately-important priority. Fix may not be included in next release.
    and removed
    🚨 criticalP0 critical issue. Requires immediate fix
    triage meI really want to be triaged.
    on Jun 11, 2018
  8. yihanzhen
    added
    api: monitoringIssues related to the Cloud Monitoring API.
    and removed
    api: pubsubIssues related to the Pub/Sub API.
    on Jun 27, 2018
  9. JustinBeckwith
    added
    🚨 criticalP0 critical issue. Requires immediate fix
    on Dec 2, 2018
  10. sduskis
    removed
    🚨 criticalP0 critical issue. Requires immediate fix
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Dec 3, 2018
  11. sduskis commented on Dec 3, 2018

    @sduskis
    sduskis
    on Dec 3, 2018
    Contributor
    More actions

    At this point, I think that there isn't enough information to answer the question. Pub/Sub quotas are described here: https://cloud.google.com/pubsub/quotas

    The INTERNAL issue is potentially a grpc issue. We would need a bit more information before proceeding. Also, we'd likely request that you use a newer version of the client, since these types of issues get resolved with newer versions of the library.

    If there's any new information, please reopen the issue.

  12. sduskis
    closed this as completedon Dec 3, 2018
  13. suztomo
    added 2 commits that reference this issue on Mar 9, 2026

    deps: update dependency com.google.cloud:google-cloud-datacatalog-bom…

    e3b934f

    chore(main): release 2.40.3 (#3325)

    4b9613d
  14. chingor13
    added a commit that references this issue on Mar 30, 2026

    test(deps): update dependency io.github.classgraph:classgraph to v4.8…

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

Metadata

Metadata

Assignees

  • @andreamlin
    andreamlin

Labels

api: monitoringIssues related to the Cloud Monitoring API.type: questionRequest for information or clarification. Not an issue.

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.