Stop the JSONRPC server cleanly on stdin EOF instead of busy-looping
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 50/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- api, backend, testing-qa
Línea de trabajo
Start at crates/pet-jsonrpc/src/server.rs, especially start_server, and trace the transport read loop and shutdown path. Reproduce the stdin-EOF behavior with the bounded subprocess harness described in the issue, then add injectable-reader tests for clean and truncated EOF cases plus read errors. Done means deterministic cleanup and successful exit within one second across platforms without disrupting valid streaming.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Tracking plan: #528
Priority: P1. Evidence: reproduced on Windows at 4e523ba.
Problem
The server treats stdin EOF as an empty header and immediately repeats the read/error loop instead of exiting. In a bounded reproduction, closing stdin after a successful info exchange left PET alive after 251 ms, consuming 234 ms of CPU and writing at least 991,232 bytes to stderr.
Source: start_server.
Reproduction
Start pet server with piped stdin/stdout/stderr. Send a correctly framed info request and wait for its response. Close the parent's stdin pipe while continuing to drain stderr. Observe that PET does not exit and repeatedly logs a missing Content-Length error. Use a bounded harness that terminates only its own child after observing the behavior.
Scope
- Treat EOF at the next-frame boundary as normal termination; distinguish truncated headers/payloads from clean EOF.
- Return from the transport loop rather than using an unconditional diverging loop, and define server shutdown/worker cleanup behavior.
- Keep broken-pipe/read/write failures explicit without retrying indefinitely or polluting protocol stdout.
- Make the transport reader injectable so EOF and partial-read tests do not require a permanently running server.
Acceptance criteria
- Closing stdin after a normal exchange exits the subprocess successfully within 1 second on Windows, Linux, and macOS, without a busy loop or error flood.
- Clean EOF, EOF during a header, EOF during a payload, and actual read errors have deterministic tests and documented outcomes.
- Shutdown during an active request does not leave orphaned work or wait forever; cleanup semantics are tested.
- Existing valid request/notification streaming continues to work.
- Test clients can request normal shutdown/close input and use forced termination only as a bounded failure fallback.
Dependencies
No prerequisite. Land early: correct shutdown enables trustworthy coverage collection from server subprocesses. Keep framing/ID expansion in its separate issue under #528.
- Lenguaje dominante
- Rust
- Estrellas
- 207
- Forks
- 45
- Merge medio
- 3 d 6 h
- PR fusionados (30 d)
- 12
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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 microsoft/python-environment-tools
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
debt
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
microsoft/python-environment-tools#538 · 1 comentario ·
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
debt
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
microsoft/python-environment-tools#533 · 2 comentarios ·
Todos los issues de microsoft/python-environment-tools
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
TheLarkInn/aipm#2413 ·
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
alexgorbatchev/simple-ptt#15 ·
-
tooling
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
todo:ticket
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
taikoxyz/taiko-mono#22168 · 1 comentario ·