-
Notifications
You must be signed in to change notification settings - Fork 561
feat: Add flag to capture exceptions on futures in concurrent integration #4771
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
Conversation
…urrent-integration-exceptions-on-future
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
…urrent-integration-exceptions-on-future
…urrent-integration-exceptions-on-future
client_options=sentry_sdk.get_client().options, | ||
mechanism={"type": "concurrent", "handled": False}, | ||
) | ||
sentry_sdk.capture_event(event, hint=hint) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Exception Callback Fails Context and Cancellation Handling
The report_exceptions
callback doesn't use the isolation_scope
and current_scope
forked at submission time, so captured exception events lack proper context. Also, future.exception()
can raise CancelledError
if the future was cancelled, causing the callback to fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems valid at first sight, I'll see if I can reproduce first-hand before changing
Need to revisit this to see if we want a dedicated |
Provide the option to record when an exception is set on a
Future
returned byThreadPoolExecutor.submit()
. These were previously thrown only whenresult()
is called on the future. Otherwise the exception is only stored on the future, and does not detected by theThreadingIntegration
despiteconcurrent
usingthreading
under the hood.Closes #2614