question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infinite loop when API quota is exceeded and reportUncaughtExceptions is enabled

See original GitHub issue

When there are large volumes of errors that exceed Stackdriver reporting quota, HTTP 429 responses are received as a response, letting the caller know too many requests are being sent.

These are thrown as errors by StackdriverErrorReporter here: https://github.com/GoogleCloudPlatform/stackdriver-errors-js/blob/master/stackdriver-errors.js#L184

If reportUncaughtExceptions is enabled, then this results in the reporter trying to report those errors, receiving more HTTP 429 responses, and going into an infinite loop.

The end result is a tab “crash” (infinite loop causing CPU to be used at 100% and browser tab to become unresponsive).

I can do the work to create a fix and send over a PR, but I’m a little unsure of the best way to handle this scenario.

  1. We could just not log these, but it might be useful to surface this somehow so you’d be aware you’re exceeding your quota?

  2. One thought is to sample those kinds of errors at a reduced rate, i.e.

if (xhr.status === 429 && Math.random() > 0.99) {
  // throw the error
}

I mean, you wouldn’t get a lot of them, but it might be enough that you’d investigate the issue?

Appreciate any thoughts / feedback on how to fix this, thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sterencommented, Apr 26, 2021

I need to publish a new version in npm, which contributors cannot do. I’ll do it this week.

1reaction
sterencommented, Apr 22, 2021

Great catch.

I would expect customers to learn about quota limits from different mechanisms instead of relying on this client side library, so I suggest to implement 1 (not log these)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Infinite loop on exceeded quota account · Issue #361 - GitHub
Description When capturing an event on an account with exceeded quota, the lib gets stuck in a infinite loop, eating 100% of CPU....
Read more >
Using Api key responds with exceeded quota - Stack Overflow
The first thing i want to say is that you are making the request correctly. It actually looks like you copied the one...
Read more >
Monitor API quotas - Google Workspace Admin Help
Data migration generates many API requests. It's possible that your migration might exceed daily API quota levels when you migrate data to Google...
Read more >
Viewing online file analysis results for 'SaveMySnaps.apk'
Minimum SDK: 14 (Ice Cream Sandwich); Target SDK: 14 (Ice Cream Sandwich); Version Code: 135 ... Seems like an infinite loop of pushing...
Read more >
mozilla-central: changeset 391661 ...
const USER_DISABLE_PREF = "extensions.screenshots.disabled"; ... Only used for window.onerror to not cause an infinite loop of * rethrowing.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found