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
metricstore.Shutdown()
ms := metricstore.GetMemoryStore()
if ms != nil {
metricstore.Shutdown()
}
// Shutdown archiver with 10 second timeout for fast shutdown
if err := archiver.Shutdown(10 * time.Second); err != nil {