Add an automated graceful-shutdown test for `extenddb serve --foreground`
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 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 小时
- 30 天内合并 PR
- 25
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ExtendDB/extenddb 的其他 Issue
-
backend:mongodb bug
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 2 天内回复
-
backend:cassandra bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 2 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 2 天内回复
-
backend:cassandra 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 天内回复
查看 ExtendDB/extenddb 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
good first issue hardware help wanted no-box serve
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
bug good first issue query-log web
难度 2/5 1-3 小时 新手友好度 85/100
ferrous-networking/ferrous-dns#326 ·
维护者通常 1 天内回复