elad-bar / ha-shinobi

Shinobi Video custom component for HA
53 stars 5 forks source link

Integrations should cancel non-critical tasks when receiving the stop event #51

Closed chemelli74 closed 12 months ago

chemelli74 commented 1 year ago

Hi,

I often get the following warning during shutdown (v3.0.1/v3.0.2 of the integration, HA 2023.7.3) :

2023-08-04 12:18:14.396 WARNING (MainThread) [homeassistant.core] Task <Task pending name='dispatcher shinobi_API_STATUS_SIGNAL' coro=<Coordinator._on_api_status_changed() running at /usr/src/homeassistant/homeassistant/util/logging.py:154> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[set.remove()]> was still running after stage 2 shutdown; Integrations should cancel non-critical tasks when receiving the stop event to prevent delaying shutdown

Thx for investigating,

Simone

elad-bar commented 1 year ago

with v3.0.2 and HA v2023.8.1 i'm no longer getting that warning, pls update me after upgrade HA v2023.8.x if still happens

thanks

elad-bar commented 1 year ago

@chemelli74 did you manage to test it with 2023.8.x and 3.0.2 of integration?

thanks

chemelli74 commented 1 year ago

CAM was disconnected and I'm not at home... sigh... sigh...

elad-bar commented 1 year ago

@chemelli74 is it still relevant?

thanks

chemelli74 commented 1 year ago

I don't see it anymore in the log, but it's also true that the integration is not creating the CAM entity actually :-(

Simone

chemelli74 commented 1 year ago

Really sorry, spoken too soon. Here a message with 3.0.4:

2023-08-31 18:48:17.799 WARNING (MainThread) [homeassistant.core] Task <Task pending name='dispatcher shinobi_API_STATUS_SIGNAL' coro=<Coordinator._on_api_status_changed() running at /usr/src/homeassistant/homeassistant/util/logging.py:154> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[set.remove()]> was still running after stage 2 shutdown; Integrations should cancel non-critical tasks when receiving the stop event to prevent delaying shutdown

Simone

elad-bar commented 1 year ago

Which version of HA?

chemelli74 commented 1 year ago

Which version of HA?

2023.9.b1

Simone

chemelli74 commented 1 year ago

Hi, I'm now on Home Assistant 2023.10.0b2 but this issue is unfortunately still relevant:

2023-09-29 21:03:10.225 WARNING (MainThread) [homeassistant.core] Task <Task pending name='dispatcher shinobi_API_STATUS_SIGNAL' coro=<Coordinator._on_api_status_changed() running at /usr/src/homeassistant/homeassistant/util/logging.py:154> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[set.remove()]> was still running after stage 2 shutdown; Integrations should cancel non-critical tasks when receiving the stop event to prevent delaying shutdown

elad-bar commented 1 year ago

merged your fix, thanks!!! new release v3.0.5

chemelli74 commented 12 months ago

After a couple of week using the latest release in prod, I would say this is fixed.