Log waiting tasks in bootstrap that are delaying startup (#112637)

This commit is contained in:
J. Nick Koston 2024-03-07 13:18:18 -10:00 committed by GitHub
parent 27af6f1466
commit 5da629b3e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 110 additions and 7 deletions

View file

@ -402,6 +402,18 @@ class HomeAssistant:
max_workers=1, thread_name_prefix="ImportExecutor"
)
@property
def _active_tasks(self) -> set[asyncio.Future[Any]]:
"""Return all active tasks.
This property is used in bootstrap to log all active tasks
so we can identify what is blocking startup.
This property is marked as private to avoid accidental use
as it is not guaranteed to be present in future versions.
"""
return self._tasks
@cached_property
def is_running(self) -> bool:
"""Return if Home Assistant is running."""