#Debugging asyncio slowdowns

1 messages · Page 1 of 1 (latest)

compact aspen
#

You'll start seeing warnings like 2024-02-28 13:06:34.376 WARNING (MainThread) [asyncio] Executing <Task pending name='config entry setup shellyplugus-c049ef8c0620 shelly da36e9d066688d9c88458d47c2582d16' coro=<ConfigEntry.async_setup() running at /Users/bdraco/home-assistant/homeassistant/config_entries.py:504> wait_for=<_GatheringFuture pending cb=[Task.task_wakeup()] created at /opt/homebrew/Cellar/python@3.12/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/tasks.py:714> cb=[gather.<locals>._done_callback() at /opt/homebrew/Cellar/python@3.12/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/tasks.py:769] created at /Users/bdraco/home-assistant/homeassistant/util/async_.py:35> took 0.137 seconds

kind osprey
#

./tenor then what

#

should i be restarting over and over hoping to see something like that?

compact aspen
#

3 or 4 times

#

otherwise its not going to show

kind osprey
#

kk

#

sorry that wasnt super clear lol

#

and it'll show as an error in the logs right?

#

derp i see above, a warning

#

is unifi the bad boy?

#

fwiw this error showed up 10 min after home assistant was restarted

compact aspen
#

sure seems like unifi is an issue

#

or something else is blocking the loop and unifi is very active so its getting blocked

#

another thing you can do is turn off debugpy, restart and run profiler.start and send the callgrind file

kind osprey
#

ok trying that now

kind osprey
compact aspen
#

60 is fine

kind osprey
#

does it need to be immediately after a restart?

compact aspen
#

the sooner the better

kind osprey
#

i walked away to feed dog i'll restart and run a second one

#

can i not create an automation to run the service after uptime = 1 second? or <10 or something?