Session becomes unattachable after shell->client poll() returns EINTR
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Lee los dos bucles de poll en libshpool/src/daemon/shell.rs y shell_inject.rs; el issue enlaza el bucle de shell alrededor de las líneas 541–547. Comprueba cómo gestiona cada bucle los errores de poll y reproduce EINTR o añade cobertura para ese caso. Se considera terminado cuando ambos bucles reintentan ante EINTR y la sesión sigue pudiendo conectarse después de la señal descrita en la reproducción.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 2k
- Forks
- 70
- Merge medio
- 2 d 3 h
- PR fusionados (30 d)
- 6
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de shell-pool/shpool
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
shell-pool/shpool#463 ·
Los mantenedores suelen responder en 1 día
-
misc LLM reportsAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 5/100
shell-pool/shpool#454 ·
Los mantenedores suelen responder en 1 día
-
vterm
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
shell-pool/shpool#445 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
publish .deb filesAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
shell-pool/shpool#429 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
shell-pool/shpool#412 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de shell-pool/shpool
Issues similares
-
Ignore entry for RUSTSEC-2026-0002 no longer matches anything (`lru` is no longer in `Cargo.lock`)Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
influxdata/influxdb#27767 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
oras-project/rust-oci-client-node#132 ·
Los mantenedores suelen responder en 2 días
-
Ignore entry for RUSTSEC-2020-0168 no longer matches anything (`mach` is no longer in `Cargo.lock`)Posiblemente ocupada @zyl71 la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Blockstream/lwk#213 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
libracoder/kiri#749 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
manuscript-lang/manuscript#6389 ·
Los mantenedores suelen responder en 1 día