-
Notifications
You must be signed in to change notification settings - Fork 533
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
Improve asyncio integration error handling. #4129
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #4129 +/- ##
==========================================
+ Coverage 79.53% 79.57% +0.03%
==========================================
Files 140 140
Lines 15594 15608 +14
Branches 2647 2648 +1
==========================================
+ Hits 12403 12420 +17
+ Misses 2351 2349 -2
+ Partials 840 839 -1
|
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.
I think this is good. We might consider changing the log level of the shutdown_handler
message to debug, but it's probably also fine as info
since it should only be logged at shutdown.
I think |
Instrumenting asyncio projects can be confusing. Here are two improvements:
If users try to init the Sentry SDK outside of an async loop, a warning message will now printed instructing them how to correctly call init() in async envrionments. Including a link to the docs.
During shutdown of Python unfinished async tasks emit an error
Task was destroyed but it is pending!
. This happens if you use Sentry or not. The error message is confusing and led people to believe the Sentry instrumentation caused this problem. This is now remediated byTask was destroyed but it is pending!
but that those are OK and not a problem with the users code or Sentry.Before this PR the users saw this during shutdown:
With this PR the users will see this during shutdown:
Note the INFO message on top and also the task name on the bottom.
Fixes #2908
Improves #2333