Fix bugs in WAL journal pipeline

Entire-Checkpoint: 8fe0de4e6ac2
This commit is contained in:
2026-03-26 07:25:36 +01:00
parent e759810051
commit 97d65a9e5c
2 changed files with 69 additions and 61 deletions

View File

@@ -281,6 +281,12 @@ func Shutdown() {
cclog.Infof("[METRICSTORE]> Background workers cancelled (%v)", time.Since(totalStart))
if Keys.Checkpoints.FileFormat == "wal" {
// Signal producers to stop sending before closing channels,
// preventing send-on-closed-channel panics from in-flight NATS workers.
walShuttingDown.Store(true)
// Brief grace period for in-flight DecodeLine calls to complete.
time.Sleep(100 * time.Millisecond)
for _, ch := range walShardChs {
close(ch)
}