Skip to content

fix(asyncio): Remove shutdown handler#4237

Merged
sentrivana merged 1 commit into
masterfrom
ivana/asyncio-shutdown-handler
Apr 3, 2025
Merged

fix(asyncio): Remove shutdown handler#4237
sentrivana merged 1 commit into
masterfrom
ivana/asyncio-shutdown-handler

Conversation

@sentrivana

@sentrivana sentrivana commented Apr 3, 2025

Copy link
Copy Markdown
Contributor

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

@antonpirker antonpirker left a comment

Copy link
Copy Markdown
Contributor

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

codecov Bot commented Apr 3, 2025

Copy link
Copy Markdown

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
@sentrivana
sentrivana deleted the ivana/asyncio-shutdown-handler branch April 3, 2025 10:38
@BYK

BYK commented Apr 14, 2025

Copy link
Copy Markdown
Member

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