Add an automated graceful-shutdown test for `extenddb serve --foreground`
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
調査の方向性
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:
- 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
- 主要言語
- Rust
- スター
- 517
- フォーク
- 60
- 平均マージ
- 2日 23時間
- マージ済み PR(30日)
- 25
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ExtendDB/extenddb のほかの issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 2 日以内に返信
-
[storage.cassandra] accepts unknown keys silently対応中かも @LeeroyHannigan が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ExtendDB/extenddb#540 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 2 日以内に返信
ExtendDB/extenddb の issue をすべて見る
似ている issue
-
A-UI C-Bug S-Needs-Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
bevyengine/bevy#26330 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
chipsalliance/caliptra-sw#4335 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
aaif-goose/goose#13158 ·
メンテナーはふだん 1 日以内に返信
-
agent enhancement provider:anthropic providers triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
can1357/oh-my-pi#17148 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
A-documentation good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
rust-lang/rust-clippy#17926 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信