-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Detect blocking stat syscalls in the event loop #120273
base: dev
Are you sure you want to change the base?
Conversation
There are currently too many places core is still doing this to merge this PR. This PR is available for anyone who wants to check and fix their integration ahead of time.
There are currently too many places core is still doing this to merge this PR. This PR is available for anyone who wants to check and fix their integration ahead of time.
There are currently too many places core is still doing this to merge this PR. This PR is available for anyone who wants to check and fix their integration ahead of time.
@@ -126,6 +126,9 @@ def _dev_help_message(what: str) -> str: | |||
) | |||
|
|||
|
|||
_depth = [0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linecache
can potentially do a blocking stat
which would cause a loop which is why we have a depth check. There is currently no solution for linecache
at this time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM,
Thanks @bdraco 👍
Thanks. It will probably be a few weeks before I finish audited and this can be merged, but its good to have it available for anyone who wants to check now. |
…g I/O These do blocking I/O later in the startup process discovered in #120273
I've been holding off on this until the new hacs release as right now it has too many hits here and will fill up the log. They are all fixed in the latest repo, but not in a release yet |
There are so many....... its going to take a while to get to the point where we can merge this. |
Proposed change
There are currently too many places core is still doing this to
merge this PR.
It will likely take a few weeks before we fix all occurrences in
core. This PR is available for anyone who wants to check
and fix their integration ahead of time.
Known ones in core to fix
2024-06-23 18:11:36.456 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to stat with args ('/OFFICIAL_IMAGE',) inside the event loop by integration 'ffmpeg' at homeassistant/components/ffmpeg/__init__.py, line 157: if is_official_image(): (offender: <frozen genericpath>, line 30: ?), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+ffmpeg%22
2024-06-23 18:11:35.777 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to stat with args (PosixPath('/.dockerenv'),) in /opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/pathlib.py, line 840: return os.stat(self, follow_symlinks=follow_symlinks) inside the event loop; This is causing stability issues. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue
2024-06-23 18:11:35.775 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to stat with args ('/Users/bdraco/media',) in <frozen genericpath>, line 42: ? inside the event loop; This is causing stability issues. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue
2024-06-23 18:11:35.774 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to stat with args ('/Users/bdraco/home-assistant/config',) in <frozen genericpath>, line 42: ? inside the event loop; This is causing stability issues. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: