diff --git a/pkg/query/endpointset.go b/pkg/query/endpointset.go index a8005c571d..ade3e593cb 100644 --- a/pkg/query/endpointset.go +++ b/pkg/query/endpointset.go @@ -612,6 +612,7 @@ func (e *EndpointSet) GetEndpointStatus() []EndpointStatus { statuses := make([]EndpointStatus, 0, len(e.endpoints)) for _, v := range e.endpoints { + v := v v.mtx.RLock() defer v.mtx.RUnlock() diff --git a/pkg/rules/manager.go b/pkg/rules/manager.go index 870b782732..ab83159250 100644 --- a/pkg/rules/manager.go +++ b/pkg/rules/manager.go @@ -159,6 +159,7 @@ func NewManager( // Run is non blocking, in opposite to TSDB manager, which is blocking. func (m *Manager) Run() { for _, mgr := range m.mgrs { + mgr := mgr go mgr.Run() } }