From d98d0278a2e190fb606afce76bd6752be32e91c9 Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Tue, 15 Nov 2022 12:13:10 -0800 Subject: [PATCH 1/2] Bump to 2.9.7-RC1 Signed-off-by: Derek Collison --- server/const.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/const.go b/server/const.go index a28ab388..d131f26a 100644 --- a/server/const.go +++ b/server/const.go @@ -41,7 +41,7 @@ var ( const ( // VERSION is the current version for the server. - VERSION = "2.9.7-beta" + VERSION = "2.9.7-RC1" // PROTO is the currently supported protocol. // 0 was the original From 9f6db7193796e846ca72a024d19f207041c306da Mon Sep 17 00:00:00 2001 From: Colin Sullivan Date: Tue, 15 Nov 2022 14:20:16 -0700 Subject: [PATCH 2/2] Fix concurrent map write Signed-off-by: Colin Sullivan --- server/filestore.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/filestore.go b/server/filestore.go index 9d68997c..782268c6 100644 --- a/server/filestore.go +++ b/server/filestore.go @@ -6233,6 +6233,9 @@ func (o *consumerFileStore) UpdateConfig(cfg *ConsumerConfig) error { } func (o *consumerFileStore) Update(state *ConsumerState) error { + o.mu.Lock() + defer o.mu.Unlock() + // Sanity checks. if state.AckFloor.Consumer > state.Delivered.Consumer { return fmt.Errorf("bad ack floor for consumer") @@ -6262,12 +6265,8 @@ func (o *consumerFileStore) Update(state *ConsumerState) error { } } - // Replace our state. - o.mu.Lock() - // Check to see if this is an outdated update. if state.Delivered.Consumer < o.state.Delivered.Consumer { - o.mu.Unlock() return fmt.Errorf("old update ignored") } @@ -6276,7 +6275,6 @@ func (o *consumerFileStore) Update(state *ConsumerState) error { o.state.Pending = pending o.state.Redelivered = redelivered o.kickFlusher() - o.mu.Unlock() return nil }