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
Forcefully killing the application can leave NATS messages unacknowledged, ClickHouse batches half-written, or metrics unflushed, potentially leading to data inconsistencies.
Proposed Solution
Implement a signal listener (SIGTERM/SIGINT) that triggers a coordinated shutdown sequence. This will stop the API listeners first, then flush all pending data buffers to ClickHouse, and finally close database connections.
Alternatives Considered
None. Maybe some database crash recovery but we should not depend on that nor use it as a graceful shutdown method.
Activity
[-][feature] Graceful Shutdown & Resource Cleanup[/-][+]Graceful Shutdown & Resource Cleanup[/+]EricAndrechek commentedon May 15, 2026
Closing — implementation has shipped.
The coordinated shutdown sequence requested in the issue body is in
cmd/wavehouse/main.go:378-393:The earlier
otelShutdown(ctx)(~line 123) flushes telemetry providers (traces/metrics/logs) on the same shutdown path.Matches the proposed-solution requirements:
cfg.Server.ShutdownTimeout)srv.Shutdown)ingestStream.Stop)otelShutdown)Reopen if a specific resource is leaking — e.g. if you find the ClickHouse driver isn't being closed via this path, that's a follow-up.
chore: claude code native improvements (#147)