Session becomes unattachable after shell->client poll() returns EINTR
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Leggi i due cicli di poll in libshpool/src/daemon/shell.rs e shell_inject.rs; l’issue rimanda al ciclo della shell intorno alle righe 541–547. Verifica come ciascun ciclo gestisce gli errori di poll, quindi riproduci EINTR oppure aggiungi test che lo coprano. Il lavoro è completato quando entrambi i cicli riprovano in caso di EINTR e la sessione può ancora essere collegata dopo il segnale descritto nella riproduzione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
When several sessions share one daemon, a session can break permanently: every later shpool attach <name> for it exits with status 1, and the daemon logs
ERROR handle_conn{cid=..}:handle_attach: error shuffling bytes: attaching new client stream to shell->client thread
The session stays listed (disconnected/attached) but can never be attached again; only shpool kill recovers it.
Cause
The session's shell->client thread had exited earlier, at the moment another session in the same daemon spawned its shell:
INFO handle_conn{cid=18}:handle_attach:spawn_subshell: about to fork subshell noecho=false
ERROR shell->client{s="main" cid=3}: polling pty master: EINTR
poll(2) returns EINTR whenever a signal is delivered to the polling thread, and that is never restarted, whatever SA_RESTART says. The shell->client loop treats it as fatal:
So any signal the kernel happens to deliver to that thread (for example the SIGCHLD when another session's shell starts or exits) ends the thread and leaves the session unattachable. The sentinel poll in shell_inject.rs has the same pattern.
Suggested fix
Retry on EINTR in both poll loops, e.g. Err(nix::errno::Errno::EINTR) => continue,, or block the relevant signals on these threads.
Reproduction
shpool 0.11.5 (shpool-x86_64-unknown-linux-gnu release binary), Ubuntu 24.04 container:
- Attach to session
aand leave it running a command that prints continuously. - In the same daemon, repeatedly create sessions, run
exitin them, and force-reattacha(we drove ~20 sessions through ttyd). - It is a race, so it does not happen every round; we hit it twice. When
a's shell->client thread logspolling pty master: EINTR, every later attach toafails as above.
We hit it on an x86_64 container under Docker Desktop on Apple silicon (Rosetta), which may deliver signals to that thread more often, but the code path is the same on native Linux.
Workaround
One daemon per session (shpool --socket <per-session path> attach <name>), so no other session's children signal that daemon. With that, the same stress run passed repeatedly.
- Lingua principale
- Rust
- Stelle
- 2k
- Fork
- 70
- Merge medio
- 2g 3h
- PR unite (30g)
- 6
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di shell-pool/shpool
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
shell-pool/shpool#463 ·
I maintainer di solito rispondono entro 1 giorno
-
misc LLM reportsAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 5/100
shell-pool/shpool#454 ·
I maintainer di solito rispondono entro 1 giorno
-
vterm
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
shell-pool/shpool#445 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
publish .deb filesAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
shell-pool/shpool#429 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
shell-pool/shpool#412 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di shell-pool/shpool
Issue simili
-
Ignore entry for RUSTSEC-2026-0002 no longer matches anything (`lru` is no longer in `Cargo.lock`)Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
influxdata/influxdb#27767 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
oras-project/rust-oci-client-node#132 ·
I maintainer di solito rispondono entro 2 giorni
-
Ignore entry for RUSTSEC-2020-0168 no longer matches anything (`mach` is no longer in `Cargo.lock`)Forse già presa @zyl71 l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
Blockstream/lwk#213 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
libracoder/kiri#749 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
manuscript-lang/manuscript#6389 ·
I maintainer di solito rispondono entro 1 giorno