diff --git a/server/cluster/coordinator.go b/server/cluster/coordinator.go index 5afb0f211f2..2b18a17a38f 100644 --- a/server/cluster/coordinator.go +++ b/server/cluster/coordinator.go @@ -380,12 +380,13 @@ func (c *coordinator) resetSchedulerMetrics() { func (c *coordinator) collectHotSpotMetrics() { c.RLock() - defer c.RUnlock() // Collects hot write region metrics. s, ok := c.schedulers[schedulers.HotRegionName] if !ok { + c.RUnlock() return } + c.RUnlock() stores := c.cluster.GetStores() status := s.Scheduler.(hasHotStatus).GetHotWriteStatus() pendings := s.Scheduler.(hasHotStatus).GetWritePendingInfluence()