Safeguard metricstore shutdown if internal metricstore is not initialized

This commit is contained in:
2026-03-05 10:37:33 +01:00
parent 47181330e9
commit ddda341e10

View File

@@ -424,7 +424,11 @@ func (s *Server) Shutdown(ctx context.Context) {
} }
// Archive all the metric store data // Archive all the metric store data
ms := metricstore.GetMemoryStore()
if ms != nil {
metricstore.Shutdown() metricstore.Shutdown()
}
// Shutdown archiver with 10 second timeout for fast shutdown // Shutdown archiver with 10 second timeout for fast shutdown
if err := archiver.Shutdown(10 * time.Second); err != nil { if err := archiver.Shutdown(10 * time.Second); err != nil {