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.

Sentry is noisy on process exit

See original GitHub issue

We are using Sentry to report errors from cron tasks. We have MAILTO set as a backup so that we receive emails about critical errors which happen before raven has a chance to initialize.

This leads to us getting the occasional email containing:

Sentry is attempting to send 1 pending error messages
Waiting up to 10 seconds
Press Ctrl-C to quit

It happens because there’s a hardcoded initial_timeout of 0.1 seconds in the process exit hook. Is there any chance you could make this timeout configurable the way shutdown_timeout is?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:23
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
whatisaphonecommented, Jul 24, 2018

https://github.com/getsentry/raven-python/blob/a698fc406d2e0f26616f0163b2b22e1a3a5b30f5/raven/transport/threaded.py#L62

             timeout = self.options['shutdown_timeout']
-
-            # wait briefly, initially
-            initial_timeout = min(0.1, timeout)
+            initial_timeout = self.options['initial_timeout']

             if not self._timed_queue_join(initial_timeout):

Who will be the hero?


If you guys really want to hardcode this timeout and send to stdout, I thought of an alternative that would also solve the problem. Instead of unconditionally sending this through stdout where it will clobber your program output, send it through Python’s logging framework with a suitably unique logger name such as raven.shutdown_flush. Then add a default handler for that logger during module init that sends the output to stdout. This would result in no change in the default behavior, but it would let users of the library override the default and route the message to wherever suits them best. @kornsn can send it to stderr in his apps, and the 10 people who 👍’d the issue can send it to NullHandler. Everybody wins.

4reactions
kornsncommented, Feb 22, 2017

Is it ok if this noise will be printed to stderr? I want to do so, but I’m not sure if it’s enough.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tips for Reducing JavaScript Error Noise
You can either ignore the error via the Sentry UI, or configure Raven.js to prevent them client-side using the ignoreErrors option. Doing so ......
Read more >
Node.js Sentry error caputuring not working
Sentry.captureException(e) is asynchronous, so process.exit(0) is terminating the process before Sentry.captureException is able to run.
Read more >
Sentry Tower buttons!! - The Bard's Tale IV
If I go in and out of the tower, come back, you can press the other buttons again but no noise, no timer...
Read more >
Sentry Industries FAQ's
HOW DO I USE MY BLUETOOTH SPEAKER? Android. Turn on your Bluetooth Speaker. ( Some devices require you to hold down the Bluetooth...
Read more >
Sentry 2.0 Phone Call Blocker
Block all spam calls, including those not on the Black List · Preload White List at set up. Requires Caller Id Service. ·...
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