Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shutdown being delayed for cancelling tasks #93287

Merged
merged 3 commits into from
May 21, 2023
Merged

Fix shutdown being delayed for cancelling tasks #93287

merged 3 commits into from
May 21, 2023

Commits on May 19, 2023

  1. Do not block for cancelling tasks

    Pythnon 3.11 introduced the concept of cancelling
    https://docs.python.org/3/library/asyncio-task.html#asyncio.Task.cancelling
    
    Once a task is being cancelled we should no longer block waiting
    for it.
    
    Fixes
    ```
    2023-05-19 18:52:49.856 WARNING (MainThread) [homeassistant.core] Shutdown stage 0: still running: <Task cancelling name='c200 background pull messages' coro=<PullPointManager._async_pull_messages() running at /usr/src/homeassistant/homeassistant/components/onvif/event.py:354> wait_for=<Future cancelled> cb=[set.remove(), set.remove()]>
    2023-05-19 18:52:49.858 WARNING (MainThread) [homeassistant.core] Shutdown stage 0: still running: <Task cancelling name='HD-IPC background pull messages' coro=<PullPointManager._async_pull_messages() running at /usr/src/homeassistant/homeassistant/components/onvif/event.py:354> wait_for=<Future cancelled> cb=[set.remove(), set.remove()]>
    2023-05-19 18:52:49.859 WARNING (MainThread) [homeassistant.core] Shutdown stage 0: still running: <Task cancelling name='e1 reolink background pull messages' coro=<PullPointManager._async_pull_messages() running at /usr/src/homeassistant/homeassistant/components/onvif/event.py:354> wait_for=<Future cancelled> cb=[set.remove(), set.remove()]>
    2023-05-19 18:52:49.860 WARNING (MainThread) [homeassistant.core] Shutdown stage 0: still running: <Task cancelling name='Amcrest background pull messages' coro=<PullPointManager._async_pull_messages() running at /usr/src/homeassistant/homeassistant/components/onvif/event.py:354> wait_for=<Future cancelled> cb=[set.remove(), set.remove()]>
    2023-05-19 18:52:49.860 WARNING (MainThread) [homeassistant.core] Shutdown stage 0: still running: <Task cancelling name='LC background pull messages' coro=<PullPointManager._async_pull_messages() running at /usr/src/homeassistant/homeassistant/components/onvif/event.py:354> wait_for=<Future cancelled> cb=[set.remove(), set.remove()]>
    2023-05-19 18:52:49.861 WARNING (MainThread) [homeassistant.core] Shutdown stage 0: still running: <Task cancelling name='flux_led-discovery' coro=<async_setup.<locals>._async_discovery() running at /usr/src/homeassistant/homeassistant/components/flux_led/__init__.py:97> wait_for=<_GatheringFuture pending cb=[Task.task_wakeup()]> cb=[set.remove(), set.remove()]>
    bdraco committed May 19, 2023
    Configuration menu
    Copy the full SHA
    c50ff99 View commit details
    Browse the repository at this point in the history
  2. fix compat

    bdraco committed May 19, 2023
    Configuration menu
    Copy the full SHA
    a1d86c2 View commit details
    Browse the repository at this point in the history
  3. lint

    bdraco committed May 19, 2023
    Configuration menu
    Copy the full SHA
    c52d01b View commit details
    Browse the repository at this point in the history