Skip to content

AsyncioIntegration signal handling #4234

Closed

Description

@kerenkhatiwada

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2.24.0

Steps to Reproduce

A user reported the following via discord:

When i try to send SIGINT by ctrl+c nothing happens and program is waiting for 10 seconds, but in normal situation it should be stopped with KeyboardInterrupt. This code works as expected after reverting code before this #4129 (version 2.22.0).

from asyncio import sleep
import sentry_sdk
from sentry_sdk.integrations.asyncio import AsyncioIntegration
def init_sentry() -> None:
    sentry_sdk.init(
        dsn="dsn",
        integrations=[
            AsyncioIntegration(),
        ],
    )

async def main():
    init_sentry()
    await sleep(10)
asyncio.run(main())

Expected Result

Pressing ctrl+c during the await sleep() should immediately raise a KeyboardInterrupt

Actual Result

Pressing ctrl+c during the await sleep() doesn't immediately raise a KeyboardInterrupt

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Apr 2, 2025
  2. sentrivana commented on Apr 3, 2025

    @sentrivana
    Collaborator

    We'll check whether this is an issue with the shutdown handler we added.

  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Apr 3, 2025
  4. added theissue type on Apr 3, 2025
  5. sentrivana commented on Apr 3, 2025

    @sentrivana
    Collaborator

    Verified that the issue goes away if the handler is removed.

    Fix will be out with the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions