wakepy
wakepy copied to clipboard
wakepy freezes ubuntu when using it repeatedly (10k times) in a loop on Ubuntu (Gnome SessionManager)
Found this one accidentally when debugging https://github.com/fohrloop/wakepy/issues/276. This will freeze Ubuntu 22.04, GNOME 42.9, development version of 0.8.0 wakepy (for example https://github.com/fohrloop/wakepy/commit/c574e529ea01fdeb4dbb4469bf9d1b84841af730):
from wakepy import keep
for i in range(10_000):
with keep.running() as m:
print(i)
About the behavior:
- It's not specific to wakepy. The same behavior can be reproduced by using just jeepney or dbus.
- If it does not freeze the system, it will make mouse cursor laggy. This lag is removed after logout -> login.
- Adding delay between function calls fixes the problem. For example, using 50ms delay and 80k iterations will not reproduce the issue. See this comment.
- Same behavior on Ubuntu with org.freedesktop.ScreenSaver (also on wakepy 0.7.x)
- This does not occur on Fedora 40 (Gnome 46 + dbus-broker), so either updating Gnome from 42.9 to 46 or changing dbus-daemon to dbus-broker probably fixes the broblem. (Thanks @takluyver)
Task:
- Find out what is causing the freeze and fix it