-
-
Notifications
You must be signed in to change notification settings - Fork 696
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
Data racing in keybinding execution #4769
Comments
It has always been parallel in the sense that we fork the command but don't wait for it to exit before returning control to the event loop (e.g. if you spawn firefox instead of amixer, we don't want to wait for firefox to exit). I think it's possible that some of the python core work to speed things up is causing this problem, though. The simplest solution here IMO would be to add an argument to spawn() that waitpid()s for the spawned task to exit. That way all events and commands they're bound to would be processed serially. |
This issue is stale because it has been open 90 days with no activity. Remove the |
Issue description
Several months ago I had simple keybinding for volume up/down:
EzKey("M-<Page_Up>", lazy.spawn("amixer -q -- sset Master playback 1%+"))
But after upgrade to
0.24.0
my audio channels started to disbalance (having different volume) when using this binding repeatedly e.g. pressing and holding to increase volume.After investigation it seems
amixer
is suspectible to data racing conditions (at least with pipewire backend), you can check it like this:Somehow, earlier
qtile
wasn't suspectible to this issue, probablyqtile
had changed sequential execution of keybinding to parallel at some point. Or refactored codebase, so timings between keybindings execution had decreased and nowamixer
become affected.What I propose:
flock
trick in the docs as the recommended way to bind rapidly spawning keybindingslazy.spawn("flock -xFw1 /usr/bin/amixer amixer -q -- sset Master playback 1%+")
Key(...)
interface to suppress parallel execution for some/all commands, e.g.allowed_in_parallel=False
-- for more descriptable way to serialize execution than usingflock
trickVersion
0.24.0
Backend
X11 (default)
Config
Logs
No response
Required
The text was updated successfully, but these errors were encountered: