Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Add an automated graceful-shutdown test for `extenddb serve --foreground`

Abierto
#137 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
aws, python, rust
Área
backend, testing

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:

  1. Spawns extenddb serve --foreground as a subprocess with stdout/stderr piped.
  2. Waits for the listener to come up (poll /health until 200, with a timeout).
  3. Optionally drives a PutItem through the AWS SDK to confirm a real request path is open.
  4. Sends SIGTERM to the child.
  5. Asserts the process exits with status 0 within a graceful-shutdown deadline (e.g., 10s).
  6. Asserts the PID file at ~/.extenddb/run/extenddb-<port>.pid was removed.
  7. 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 extenddb with isolated ~/.extenddb/ (e.g., via HOME override or a --run-dir option).
  • 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) and crates/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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ExtendDB/extenddb

Todos los issues de ExtendDB/extenddb

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.