Skip to content

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

Description

@alx75

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogWe hope to fix this feature/bug in the futurebugConfirmed bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions