Skip to content

Conversation

@KowalskiThomas
Copy link
Contributor

@KowalskiThomas KowalskiThomas commented Oct 24, 2025

What does this PR do?

This PR adds a new (very basic) correctness check for asyncio stacks.

Note that, for now, we focus on a basic use case, and we don't even get fully correct stacks as we don't have visibility into the asyncio.sleep call (not included in the expected regular expression).

This has been fixed in dd-trace-py but has not been released yet.

@KowalskiThomas KowalskiThomas force-pushed the kowalski/python-add-asyncio-check branch 2 times, most recently from 3a647b0 to 6d15dfd Compare November 25, 2025 09:04
@KowalskiThomas KowalskiThomas marked this pull request as ready for review November 25, 2025 09:05
@KowalskiThomas KowalskiThomas force-pushed the kowalski/python-add-asyncio-check branch from 6d15dfd to a3ac50c Compare November 25, 2025 09:09

EXECUTION_TIME_SEC = float(os.environ.get("EXECUTION_TIME_SEC", "2"))

short_task = asyncio.create_task(my_coroutine(EXECUTION_TIME_SEC / 2))
Copy link
Collaborator

Choose a reason for hiding this comment

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

💭 a sleep after this could make sure that you do not instrument it while it is not scheduled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed offline, the Task is already pretty much scheduled ("scheduled soon") after this call

r1viollet
r1viollet previously approved these changes Nov 25, 2025
Copy link
Collaborator

@r1viollet r1viollet left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks for adding this in. Just a minor idea.

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.

3 participants