Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[thread_queue] Uncaught exception not delivered when Bugsnag.notify was previously called. #727

Open
alx75 opened this issue Sep 13, 2022 · 3 comments
Labels
backlog We hope to fix this feature/bug in the future bug Confirmed bug

Comments

@alx75
Copy link

alx75 commented Sep 13, 2022

Describe the bug

Uncaught exception from a ruby script is not notified to bugsnag when:

  • thread_queue is chosen as a delivery method
  • a notification has been sent manually by calling Bugsnag.notify('my error') any time before the uncaught exception was raised.

Steps to reproduce

Configure Bugsnag with delivery method to thread_queue

Run:
Bugsnag.notify('This is notified correctly')
raise 'This is not notified with thread_queue'

Environment

  • Bugsnag version: 6.24.0
  • Ruby version: 2.7.6
  • Bundle version: 2.3.4
  • Rails version: 6.1.6.1

My understanding of the issue

Bugsnag::Delivery::ThreadQueue registers a at_exit to finish processing all notifications from the queue and then stop the thread that dequeue the notifications.
Bugsnag register a at_exit hook to deliver the unhandled error to Bugsnag::Delivery::ThreadQueue

This doesn't work when a notification was first sent with Bugsnag.notify because afterward, raising an unhandled error will be processed by Bugsnag at_exit however Bugsnag::Delivery::ThreadQueue at_exit was already processed.

@yousif-bugsnag
Copy link

Hi @alx75 , thanks for reporting this. I've been able to reproduce the issue - we're going to take a look as soon as priorities allow.

@yousif-bugsnag yousif-bugsnag added bug Confirmed bug backlog We hope to fix this feature/bug in the future labels Oct 6, 2022
@alx75
Copy link
Author

alx75 commented Oct 6, 2022

Ok thanks. Easy workaround is to use synchronous delivery mode for scripts.

@johnkiely1
Copy link
Member

Hi @alx75 . Just a quick update, this does seem to be an issue for Ruby scripts that aren't running in a webserver.
We're looking to fix it in the next major version release, for now using the synchronous delivery looks like a good option as a workaround. We will update again once that has been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We hope to fix this feature/bug in the future bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

3 participants