pyscript icon indicating copy to clipboard operation
pyscript copied to clipboard

Pyscript Delaying Home Assistant Restart

Open MizterB opened this issue 2 years ago • 0 comments

Sometimes when restarting Home Assistant, the restart cycle takes several minutes. Other times, it is less than a minute.

When inspecting the logs during shutdown, it appears that Pyscript may be causing the longer wait times. When they occur, I am seeing the following:

2023-05-02 10:45:23.819 WARNING (MainThread) [homeassistant.core] Timed out waiting for shutdown stage 3 to complete, the shutdown will continue
2023-05-02 10:45:23.819 WARNING (MainThread) [homeassistant.core] Shutdown stage 3: still running: <Task pending name='listen homeassistant_stop' coro=<async_setup_entry.<locals>.hass_stop() running at /config/custom_components/pyscript/__init__.py:350> wait_for=<Task pending name='Task-2247' coro=<Function.run_coro() running at /config/custom_components/pyscript/function.py:425> wait_for=<Task pending name='Task-43635' coro=<Function.run_coro() running at /config/custom_components/pyscript/function.py:425> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[Task.task_wakeup()]> cb=[Task.task_wakeup()]> cb=[set.remove()]>

While this points to Pyscript, it doesn't help me isolate where exactly the problem code is. Can someone please provide guidance on how to troubleshoot this?

More generally, does the above behavior represent a bug within Pyscript itself?

MizterB avatar May 02 '23 14:05 MizterB