From 066e9acee3b84b1c50fd96da897938ede7d7e252 Mon Sep 17 00:00:00 2001 From: stuart nelson Date: Tue, 20 Nov 2018 17:37:02 +0100 Subject: [PATCH] [silences] Don't merge expired silences If they're expired, they should be cleaned up on the next GC cycle, but merging them in means that they'll probably be gossip'd continually between the cluster members. Signed-off-by: stuart nelson --- silence/silence.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/silence/silence.go b/silence/silence.go index 7940ae1c45..e734021c8e 100644 --- a/silence/silence.go +++ b/silence/silence.go @@ -717,7 +717,12 @@ func (s *Silences) Merge(b []byte) error { s.mtx.Lock() defer s.mtx.Unlock() + now := s.now() + for _, e := range st { + if e.ExpiresAt.Before(now) { + continue + } if merged := s.st.merge(e); merged && !cluster.OversizedMessage(b) { // If this is the first we've seen the message and it's // not oversized, gossip it to other nodes. We don't