Closed Mariusthvdb closed 1 week ago
Hey there @exxamalte, mind taking a look at this issue as it has been labeled with an integration (gdacs
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
gdacs documentation gdacs source (message by IssueLinks)
let me add that we also found this
2024-04-30 23:01:44.131 WARNING (MainThread) [asyncio] Executing <Task finished name='track time interval 300.0' coro=<GdacsFeedEntityManager.async_init.<locals>.update() done, defined at /usr/src/homeassistant/homeassistant/components/gdacs/__init__.py:102> result=None created at /usr/src/homeassistant/homeassistant/util/async_.py:40> took 0.526 seconds
as Bdraco says:
blocks the event loop for 0.5 every time it runs
not sure if its related, but figured it might be good to mention here at least
I get the same, albeit with Better Thermostat:
Detected blocking call to import_module inside the event loop by custom integration 'better_thermostat' at custom_components/better_thermostat/model_fixes/model_quirks.py, line 14: self.model_quirks = import_module( (offender: /config/custom_components/better_thermostat/model_fixes/model_quirks.py, line 14: self.model_quirks = import_module(),
This is all I get in the logs regarding that component.
@velkrosmaak please don't use this thread for that integration. Raise it at their issue tracker
Hi!
FYI, I have the same warning message on HA 2024.7.4. Here is the full log entry, including the traceback:
2024-08-07 10:09:40.529 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module with args ('dateparser.data.date_translation_data.en',) inside the event loop by integration 'gdacs' at homeassistant/components/gdacs/__init__.py, line 115: await self._feed_manager.update() (offender: /usr/local/lib/python3.12/site-packages/dateparser/languages/loader.py, line 215: import_module("dateparser.data.date_translation_data." + lang),), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+gdacs%22
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#import_module
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
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/gdacs/__init__.py", line 115, in async_update
await self._feed_manager.update()
Thanks for the details. I believe I can now reconstruct where this issue is originated: The library used by this integration is aio-georss-gdacs which is based on library aio-georss-client which uses the dateparser library to parse date strings that are found in the GDACS RSS feed.
I am in control of the first two libraries, but I can't see any setting or option in the dateparser library to avoid that import_module
call. Even if I limit the list of languages/locales to consider to English only (which would be OK for the GDACS feed) I believe that there would still at least be that one call to import the language settings on demand.
I'll have a look if there is maybe some alternative date parsing library available, or some setting in dateparser
that I've overlooked.
The problem
as title
What version of Home Assistant Core has the issue?
2024.5.0b4
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
GDACS
Link to integration documentation on our website
https://www.home-assistant.io/integrations/gdacs
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response