0xMiden / 0xMiden/note-transport-service

No graceful shutdown (SIGTERM drops in-flight work, streams, telemetry)

未关闭
#119 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement production-readiness
主要语言
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 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。