0xMiden / 0xMiden/note-transport-service
No graceful shutdown (SIGTERM drops in-flight work, streams, telemetry)
- 主要语言
- Rust
- 星标
- 3
- 派生
- 10
- 平均合并
- 2 小时 23 分钟
- 30 天内合并 PR
- 4
描述
Severity: critical/high.
### Summary
There is no signal handling anywhere. `node.entrypoint()` (`bin/node/src/main.rs:80-81`) calls into `Server::serve()` (`crates/node/src/node/grpc/mod.rs:126`, not `serve_with_shutdown`), and no `tokio::signal` usage exists. The OTEL providers are never shut down (`crates/node/src/logging.rs` has no `shutdown()` calls).
### Impact
On SIGTERM (k8s eviction, `docker stop`) the process is terminated with default disposition:
- in-flight `SendNote` writes are cut (WAL keeps this crash-safe, but not clean);
- open `StreamNotes` streams are dropped without a GOAWAY drain;
- health is never flipped to NOT_SERVING, so the LB keeps routing during shutdown;
- OTEL spans/metrics buffered since the last export are lost.
### Recommendation
Install a SIGTERM + `ctrl_c` handler that: marks health NOT_SERVING, calls `serve_with_shutdown` with a drain grace period, signals the streamer to stop, cancels the maintenance task, and shuts down the OTEL tracer/meter providers.
---
Part of #114.
贡献指南
评估
这个 Issue 还没有评估数据。