Add an automated graceful-shutdown test for `extenddb serve --foreground`
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
Read crates/bin/src/cmd_serve.rs::run and crates/server/src/lib.rs::start_server, then inspect the existing test harness to find how it launches the server. Add a subprocess lifecycle test that waits for /health, sends SIGTERM, and checks the exit status, PID file removal, and shutdown log; isolate the run directory and capture stderr without races. Done means the test reliably covers graceful shutdown in CI.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem or use case
PR #126 added --foreground for running extenddb serve under a process supervisor. The supervisor scenario relies on graceful SIGTERM shutdown: the process must drain in-flight connections, remove its PID file, and exit non-zero only on actual failure.
Today, this is verified manually (the PR description shows kill -TERM against a foreground process), but there's no automated coverage. A regression in the signal-handling path would not be caught by CI.
The reviewer on #126 explicitly suggested cutting this as a follow-up because the current test framework is not yet set up for whole-process lifecycle tests, so the work likely involves harness changes too.
Proposed solution
Add a Python integration test (or rust integration test under tests/) that:
- Spawns
extenddb serve --foregroundas a subprocess with stdout/stderr piped. - Waits for the listener to come up (poll
/healthuntil 200, with a timeout). - Optionally drives a
PutItemthrough the AWS SDK to confirm a real request path is open. - Sends
SIGTERMto the child. - Asserts the process exits with status 0 within a graceful-shutdown deadline (e.g., 10s).
- Asserts the PID file at
~/.extenddb/run/extenddb-<port>.pidwas removed. - Asserts stderr contains the expected
Shutdown signal received, draining connections...log line.
This will probably require small additions to the test harness:
- A way to launch
extenddbwith isolated~/.extenddb/(e.g., viaHOMEoverride or a--run-diroption). - A way to grep child stderr without racing the test runner.
Context
- PR #126 review comment by
pdf-amzn, item 3. - Current foreground code path:
crates/bin/src/cmd_serve.rs::run(skips daemonize block) andcrates/server/src/lib.rs::start_server(existing graceful-shutdown handler).
Checklist
- I have searched existing issues and the roadmap for duplicates
- I have described the use case, not just the desired implementation
- Lenguaje dominante
- Rust
- Estrellas
- 517
- Forks
- 60
- Merge medio
- 2 d 23 h
- PR fusionados (30 d)
- 25
Preparar el entorno
- Incluye un Dockerfile o un 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 ExtendDB/extenddb
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 2 días
-
[storage.cassandra] accepts unknown keys silentlyPosiblemente ocupada @LeeroyHannigan la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
ExtendDB/extenddb#540 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 2 días
Todos los issues de ExtendDB/extenddb
Issues similares
-
bug llm translation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
accounts bug decoding
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
wboayue/rust-ibapi#1088 ·
Los mantenedores suelen responder en 1 día
-
chmod -v: missing 'could not be accessed' line for operands that can't be stat'edPosiblemente ocupada @emirmrkaljevic la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
gtk-rs/gtk-rs-core#2068 ·
Los mantenedores suelen responder en 6 días