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

Blocking stat() calls in the event loop #347

Open
bdraco opened this issue Jun 23, 2024 · 5 comments
Open

Blocking stat() calls in the event loop #347

bdraco opened this issue Jun 23, 2024 · 5 comments

Comments

@bdraco
Copy link

bdraco commented Jun 23, 2024

if os.path.exists(filename) is False:

if os.path.exists(filename) is False:

It looks like there are a few places that will do a blocking stat() syscall in this file.

Home Assistant will be able to detect and warn about these in the future.

https://developers.home-assistant.io/docs/asyncio_blocking_operations#stat

@gcobb321
Copy link
Owner

This has been fixed in v3.0.5.2 released a few weeks ago.

@bdraco
Copy link
Author

bdraco commented Jun 23, 2024

It looks like the open was fixed but the stat call via exists remains

@gcobb321
Copy link
Owner

I’ll check that out but wonder why I’m not getting the warning.

@bdraco
Copy link
Author

bdraco commented Jun 23, 2024

We haven't merged the check for stat calls yet so only open is being checked.

@bdraco
Copy link
Author

bdraco commented Jun 23, 2024

If you want to check the rest of the code, you can use this branch home-assistant/core#120273

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

No branches or pull requests

2 participants