Skip to content

Commit 5f71872

Browse files
authored
fix(asyncio): Remove shutdown handler (#4237)
Remove the shutdown handler from the asyncio integration. It's only purpose was to log a message, but it looks like it has [unintended side effects](#4234). Closes #4234
1 parent 0e7e2e6 commit 5f71872

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

sentry_sdk/integrations/asyncio.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import sys
2-
import signal
32

43
import sentry_sdk
54
from sentry_sdk.consts import OP
@@ -37,22 +36,6 @@ def patch_asyncio():
3736
loop = asyncio.get_running_loop()
3837
orig_task_factory = loop.get_task_factory()
3938

40-
# Add a shutdown handler to log a helpful message
41-
def shutdown_handler():
42-
# type: () -> None
43-
logger.info(
44-
"AsyncIO is shutting down. If you see 'Task was destroyed but it is pending!' "
45-
"errors with '_task_with_sentry_span_creation', these are normal during shutdown "
46-
"and not a problem with your code or Sentry."
47-
)
48-
49-
try:
50-
loop.add_signal_handler(signal.SIGINT, shutdown_handler)
51-
loop.add_signal_handler(signal.SIGTERM, shutdown_handler)
52-
except (NotImplementedError, AttributeError):
53-
# Signal handlers might not be supported on all platforms
54-
pass
55-
5639
def _sentry_task_factory(loop, coro, **kwargs):
5740
# type: (asyncio.AbstractEventLoop, Coroutine[Any, Any, Any], Any) -> asyncio.Future[Any]
5841

0 commit comments

Comments
 (0)