mirror of
https://github.com/home-assistant/core.git
synced 2025-07-07 21:37:07 +00:00
Log futures that are blocking shutdown stages (#88736)
This commit is contained in:
parent
ca539d0a09
commit
833ccafb76
@ -730,6 +730,7 @@ class HomeAssistant:
|
|||||||
"Timed out waiting for shutdown stage 1 to complete, the shutdown will"
|
"Timed out waiting for shutdown stage 1 to complete, the shutdown will"
|
||||||
" continue"
|
" continue"
|
||||||
)
|
)
|
||||||
|
self._async_log_running_tasks(1)
|
||||||
|
|
||||||
# stage 2
|
# stage 2
|
||||||
self.state = CoreState.final_write
|
self.state = CoreState.final_write
|
||||||
@ -742,6 +743,7 @@ class HomeAssistant:
|
|||||||
"Timed out waiting for shutdown stage 2 to complete, the shutdown will"
|
"Timed out waiting for shutdown stage 2 to complete, the shutdown will"
|
||||||
" continue"
|
" continue"
|
||||||
)
|
)
|
||||||
|
self._async_log_running_tasks(2)
|
||||||
|
|
||||||
# stage 3
|
# stage 3
|
||||||
self.state = CoreState.not_running
|
self.state = CoreState.not_running
|
||||||
@ -762,11 +764,18 @@ class HomeAssistant:
|
|||||||
"Timed out waiting for shutdown stage 3 to complete, the shutdown will"
|
"Timed out waiting for shutdown stage 3 to complete, the shutdown will"
|
||||||
" continue"
|
" continue"
|
||||||
)
|
)
|
||||||
|
self._async_log_running_tasks(3)
|
||||||
|
|
||||||
self.state = CoreState.stopped
|
self.state = CoreState.stopped
|
||||||
|
|
||||||
if self._stopped is not None:
|
if self._stopped is not None:
|
||||||
self._stopped.set()
|
self._stopped.set()
|
||||||
|
|
||||||
|
def _async_log_running_tasks(self, stage: int) -> None:
|
||||||
|
"""Log all running tasks."""
|
||||||
|
for task in self._tasks:
|
||||||
|
_LOGGER.warning("Shutdown stage %s: still running: %s", stage, task)
|
||||||
|
|
||||||
|
|
||||||
class Context:
|
class Context:
|
||||||
"""The context that triggered something."""
|
"""The context that triggered something."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user