Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add audit event for time.sleep #108294

Closed
encukou opened this issue Aug 22, 2023 · 0 comments
Closed

Add audit event for time.sleep #108294

encukou opened this issue Aug 22, 2023 · 0 comments
Assignees
Labels
type-feature A feature request or enhancement

Comments

@encukou
Copy link
Member

encukou commented Aug 22, 2023

Feature or enhancement

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

https://discuss.python.org/t/27214/8

Proposal:

Add an audit event that async frameworks can use to warn about a common beginner mistake -- using time.sleep instead of await asyncio.sleep.

This is not meant for async experts. There are better tools for diagnosing “freezes” in async code, but to use those you need to know/suspect that what you're debugging is an “async issue”.

Audit events are cheap (if unused), so I'd like to put it in even though the responses on Discourse were “meh”.

This audit event is not really security-related, but Steve said he wouldn't oppose it going in.

Linked PRs

@encukou encukou added the type-feature A feature request or enhancement label Aug 22, 2023
@encukou encukou self-assigned this Aug 22, 2023
@encukou encukou closed this as completed Aug 23, 2023
@encukou encukou reopened this Aug 23, 2023
encukou added a commit that referenced this issue Sep 5, 2023
I've also cleaned the tests up a bit to make this easier to test.
@encukou encukou closed this as completed Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant