You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2024-07-17 18:41:54.986 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to listdir with args ('/usr/local/lib/python3.12/site-packages/botocore/data/sns',) inside the event loop by integration 'aws' at homeassistant/components/aws/notify.py, line 38: return await session.get_available_regions(service) (offender: /usr/local/lib/python3.12/site-packages/botocore/loaders.py, line 363: for dirname in os.listdir(possible_path):), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+aws%22
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#listdir
Traceback (most recent call last):
2024-07-17 18:41:54.994 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args ('/usr/local/lib/python3.12/site-packages/botocore/data/sns/2010-03-31/service-2.json.gz', 'rb') inside the event loop by integration 'aws' at homeassistant/components/aws/notify.py, line 38: return await session.get_available_regions(service) (offender: /usr/local/lib/python3.12/gzip.py, line 192: fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+aws%22
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/usr/src/homeassistant/homeassistant/main.py", line 223, in
sys.exit(main())
File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main
exit_code = runner.run(runtime_conf)
File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
SDK version used
1.34.131
Environment details (OS name and version, etc.)
Home Assistant Core (docker container): Alpine Linux v3.20.1
The text was updated successfully, but these errors were encountered:
Thanks for reaching out. Boto3/Botocore does not use an event loop, that is all on the aiobotocore side. (Documentation on the Boto3 event system can be found here).
Regarding the discussion in aio-libs/aiobotocore#1120 around the service models, the team has already made optimizations to reduce the size of the models. There are also open issues like #2365 and boto/boto3#3197 tracking the request to implement further improvements. On the topic of multithreading you can refer to the documentation for sessions (not thread safe) and clients.
We cannot guarantee compatibility with third-party software like Home Assistant or aiobotocore. For requests that directly involve Boto3/Botocore you can +1 (👍) existing issues or share a code snippet and logs to highlight the problem you're experiencing.
Describe the bug
Home Assistant since a few version detects blocking calls.
One is related to
botocore
and surfaces via aiobotocore.I opened a PR to fix it, but I was redirected here ( aio-libs/aiobotocore#1120 )
Expected Behavior
Avoid blocking calls inside the event loop
Current Behavior
There are blocking calls inside the event loop
Reproduction Steps
Possible Solution
None
Additional Information/Context
2024-07-17 18:41:54.986 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to listdir with args ('/usr/local/lib/python3.12/site-packages/botocore/data/sns',) inside the event loop by integration 'aws' at homeassistant/components/aws/notify.py, line 38: return await session.get_available_regions(service) (offender: /usr/local/lib/python3.12/site-packages/botocore/loaders.py, line 363: for dirname in os.listdir(possible_path):), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+aws%22
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#listdir
Traceback (most recent call last):
2024-07-17 18:41:54.994 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args ('/usr/local/lib/python3.12/site-packages/botocore/data/sns/2010-03-31/service-2.json.gz', 'rb') inside the event loop by integration 'aws' at homeassistant/components/aws/notify.py, line 38: return await session.get_available_regions(service) (offender: /usr/local/lib/python3.12/gzip.py, line 192: fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+aws%22
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/usr/src/homeassistant/homeassistant/main.py", line 223, in
sys.exit(main())
File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main
exit_code = runner.run(runtime_conf)
File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
SDK version used
1.34.131
Environment details (OS name and version, etc.)
Home Assistant Core (docker container): Alpine Linux v3.20.1
The text was updated successfully, but these errors were encountered: