From 349158a34931b628336493b65c761387a5603907 Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Mon, 11 Sep 2023 21:12:15 -0700 Subject: [PATCH] Fix for datarace accessing mirror tr Signed-off-by: Derek Collison --- server/stream.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/stream.go b/server/stream.go index e673b15746d..7290a8982b7 100644 --- a/server/stream.go +++ b/server/stream.go @@ -2273,9 +2273,6 @@ func (mset *stream) processInboundMirrorMsg(m *inMsg) bool { } } - js, stype := mset.js, mset.cfg.Storage - mset.mu.Unlock() - // Do the subject transform if there's one if mset.mirror.tr != nil { m.subj = mset.mirror.tr.TransformSubject(m.subj) @@ -2293,7 +2290,9 @@ func (mset *stream) processInboundMirrorMsg(m *inMsg) bool { } } - s := mset.srv + s, js, stype := mset.srv, mset.js, mset.cfg.Storage + mset.mu.Unlock() + var err error if node != nil { if js.limitsExceeded(stype) {