-
Notifications
You must be signed in to change notification settings - Fork 63
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
Detected blocking call #49
Comments
Issue still exists. `2024-11-10 22:50:34.006 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7f63cb67a350>, '/usr/local/lib/python3.12/site-packages/certifi/cacert.pem', None, None) inside the event loop by custom integration 'edge_tts' at custom_components/edge_tts/tts.py, line 408: async for chunk in tts.stream(): (offender: /usr/local/lib/python3.12/ssl.py, line 708: context.load_verify_locations(cafile, capath, cadata)), please create a bug report at https://github.com/hasscc/hass-edge-tts/issues 2024-11-10 22:50:34.014 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args ('/root/.netrc',) inside the event loop by custom integration 'edge_tts' at custom_components/edge_tts/tts.py, line 408: async for chunk in tts.stream(): (offender: /usr/local/lib/python3.12/netrc.py, line 74: with open(file, encoding="utf-8") as fp:), please create a bug report at https://github.com/hasscc/hass-edge-tts/issues |
I have changed line 408 in |
I think the detection is a false positive. At least I can't find any blocking code for edge-tts that can cause this. The reason the sync varient doesn't trigger it is likely because it starts a new event loop in a new thread which is likely not monitored by Home Assistant. |
Home Assistant
Core 2024.7.3
Supervisor 2024.06.2
Operating System 12.4
WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args ('/root/.netrc',) inside the event loop by custom integration 'edge_tts' at custom_components/edge_tts/tts.py, line 408: async for chunk in tts.stream(): (offender: /usr/local/lib/python3.12/netrc.py, line 74: with open(file, encoding="utf-8") as fp:), please create a bug report at https://github.com/hasscc/hass-edge-tts/issues
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
return loop.run_until_complete(setup_and_run_hass(runtime_config))
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
self._run_once()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
handle._run()
File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/src/homeassistant/homeassistant/components/tts/init.py", line 727, in get_tts_data
extension, data = await engine_instance.async_get_tts_audio(
File "/config/custom_components/edge_tts/tts.py", line 408, in async_get_tts_audio
async for chunk in tts.stream():
The text was updated successfully, but these errors were encountered: