Fix login deadlocks

Logins seem to spuriously fail with both correct or incorrect passwords.
The failure is not related to the password. `cosmic-greeter` hangs but
the GUI still works. The password text area disappears as well.

I traced this issue down to the socket. It seems like accessing the
socket deadlocks with one thread waiting for the socket to become
readable while another waits for it to become writable.

Switching to `greet-ipc`'s `TokioCodec` and adding a lock to the socket
seems to have fixed this issue. I successfully logged in and inputted
incorrect passwords consecutively without experiencing a deadlock.
This commit is contained in:
Josh Megnauth 2024-06-03 00:33:13 -04:00 committed by Jeremy Soller
parent e2a4ccc8bd
commit bba692eecb
3 changed files with 61 additions and 73 deletions

View file

@ -37,7 +37,7 @@ rust-embed = "8"
[dependencies.greetd_ipc]
version = "0.10.0"
features = ["sync-codec"]
features = ["tokio-codec"]
[features]
default = ["logind", "networkmanager", "upower"]