10000 fix(asyncio): Remove shutdown handler by sentrivana · Pull Request #4237 · getsentry/sentry-python · GitHub
[go: up one dir, main page]

Skip to content

fix(asyncio): Remove shutdown handler #4237

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

Merged
merged 1 commit into from
Apr 3, 2025

Conversation

sentrivana
Copy link
Contributor
@sentrivana sentrivana commented Apr 3, 2025

Remove the shutdown handler from the asyncio integration. Its only purpose was to log a message, but it looks like it has unintended side effects.

Closes #4234

@sentrivana sentrivana marked this pull request as ready for review April 3, 2025 10:23
@sentrivana sentrivana requested a review from a team as a code owner April 3, 2025 10:23
@sentrivana sentrivana requested a review from antonpirker April 3, 2025 10:23
Copy link
Member
@antonpirker antonpirker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sad to see the message go, but if it removes side effects...

Copy link
codecov bot commented Apr 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.50%. Comparing base (0e7e2e6) to head (d5c0f53).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@   
8000
         Coverage Diff             @@
##           master    #4237      +/-   ##
==========================================
- Coverage   79.51%   79.50%   -0.01%     
==========================================
  Files         142      142              
  Lines       15884    15876       -8     
  Branches     2716     2716              
==========================================
- Hits        12630    12623       -7     
+ Misses       2391     2388       -3     
- Partials      863      865       +2     
Files with missing lines Coverage Δ
sentry_sdk/integrations/asyncio.py 81.96% <ø> (+2.25%) ⬆️

... and 2 files with indirect coverage changes

@sentrivana sentrivana enabled auto-merge (squash) April 3, 2025 10:36
@sentrivana sentrivana merged commit 5f71872 into master Apr 3, 2025
139 checks passed
@sentrivana sentrivana deleted the ivana/asyncio-shutdown-handler branch April 3, 2025 10:38
@BYK
Copy link
Member
BYK commented Apr 14, 2025

I think add_signal_handler replaces any existing signal handlers (unlike the name suggests). There's a note on signal.signal() docs:

The previous signal handler will be returned (see the description of getsignal() above). (See the Unix man page signal(2) for further information.)

So maybe storing the previous signal handler and calling that (if it is not None) after logging the message could work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AsyncioIntegration signal handling
3 participants
0