You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fast-follow: wire stub_tracer_shutdown_hook() into shutdown coordinator (#64 + #65) #71
While rebasing #65 onto post-#64 main, a placeholder stub_tracer_shutdown_hook() was left in serve() — the intent was that #65 would replace it with a real tracer flush wired into the #64 shutdown coordinator.
Current state: the existing _tracer_guard.shutdown() at main exit DOES flush the OTel tracer correctly on clean exit, so observability data isn't lost. But on signal-driven graceful shutdown via the #64 coordinator, the tracer guard runs at process-exit AFTER the coordinator's drain — so traces emitted during drain may not flush cleanly on SIGTERM / Ctrl+C.
Scope
Replace the stub_tracer_shutdown_hook() placeholder with:
A function that calls opentelemetry::global::shutdown_tracer_provider() (or equivalent) inside the shutdown coordinator's flush phase.
Wire it into the coordinator alongside the existing DB / observability flush hooks.
Add a test that exercises the graceful-shutdown path with active spans → verifies they end up in the test sink.
Why it's not blocking
Clean-exit traces work today; only signal-shutdown traces during drain are at risk. Production observability still gets ~all traces.
Confirmed via current src/main.rs + src/observability.rs:
Clean-exit path: _tracer_guard (returned by init_tracing(endpoint, json_logs) -> Result<TracingShutdownGuard>) is owned by main(); its Drop impl calls opentelemetry::global::shutdown_tracer_provider() → OTel data flushed on normal exit. ✅
Fast-follow scope unchanged: replace the stub with a real Arc<TracerShutdownGuard> clone passed into the shutdown coordinator, so SIGTERM-triggered drain flushes the tracer before exit. Recommend folding this into the post-#64shutdown.rs::execute_drain() flush phase rather than threading a guard reference through every layer.
Activity
hyperpolymath commentedon Jun 2, 2026
Status check post-merge sequence today (#64 09:51Z → #65 09:58Z → #66 10:34Z → #75 11:07Z):
Confirmed via current
src/main.rs+src/observability.rs:_tracer_guard(returned byinit_tracing(endpoint, json_logs) -> Result<TracingShutdownGuard>) is owned bymain(); itsDropimpl callsopentelemetry::global::shutdown_tracer_provider()→ OTel data flushed on normal exit. ✅stub_tracer_shutdown_hook()is still present inserve()and not wired into the feat(lifecycle): graceful shutdown — drain in-flight + close DB + flush observability #64 graceful-shutdown coordinator. ❌ — issue remains valid.Fast-follow scope unchanged: replace the stub with a real
Arc<TracerShutdownGuard>clone passed into the shutdown coordinator, so SIGTERM-triggered drain flushes the tracer before exit. Recommend folding this into the post-#64shutdown.rs::execute_drain()flush phase rather than threading a guard reference through every layer.Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]