Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#137 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
aws, python, rust
領域
backend, testing

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Rust
スター
517
フォーク
60
平均マージ
2日 23時間
マージ済み PR(30日)
25

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ExtendDB/extenddb のほかの issue

ExtendDB/extenddb の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。