You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pyscript.reload to make it active. See it counting.
save the file again to update mtime. pyscript.reload. See it counting again.
repeat step 3 one more time. See the error below in logs.
2020-12-13 06:29:01 INFO (MainThread) [custom_components.pyscript.global_ctx] Reloaded /config/pyscript/shutdowntest.py
2020-12-13 06:29:01 INFO (MainThread) [custom_components.pyscript.file.shutdowntest.test_shutdown] stopping
2020-12-13 06:29:01 INFO (MainThread) [custom_components.pyscript.file.shutdowntest.test_startup] starting
2020-12-13 06:29:01 INFO (MainThread) [custom_components.pyscript.file.shutdowntest.test_startup] count 1
2020-12-13 06:29:01 ERROR (MainThread) [custom_components.pyscript.function] task_reaper: got exception Traceback (most recent call last):
File "/config/custom_components/pyscript/function.py", line 97, in task_reaper
await cmd[1]
RuntimeError: await wasn't used with future
2020-12-13 06:29:02 INFO (MainThread) [custom_components.pyscript.file.shutdowntest.test_startup] count 2
Once this error is produced, while the counter itself keeps counting, many other pyscript scripts stop triggering reliably as they usually do.
Repeat step 3 again and you will now see there are two counters. The previous one didn't stop, but a new one started.
Do it again and you now have three counters. etc, etc.
To fix it, comment out the script added in step 1 and restart home assistant. (without restarting home assistant and just doing pyscript.reload, only the most recent counter is stopped)
The text was updated successfully, but these errors were encountered:
Thanks for finding a simple test that fails - this fails for me too in the manner you describe. I've been investigating what's going wrong, but I've had limited time the last few days.
There's one bug that I've fixed, but it still isn't working correctly. The shutdown trigger is definitely causing some additional yet-to-be-determined problem, related to the deletion and recreation of the global context on reload using a helper task to execute all the shutdown triggers, rather than creating a new task per shutdown trigger.
I've finally managed to get this boiled down and reproduceable.
Once this error is produced, while the counter itself keeps counting, many other pyscript scripts stop triggering reliably as they usually do.
The text was updated successfully, but these errors were encountered: