Skip to content

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
Contributor

@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...

@codecov
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
@@            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