Merge branch 'main' into dev

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2023-08-31 15:52:00 -07:00
6 changed files with 176 additions and 39 deletions

View File

@@ -1881,6 +1881,10 @@ func (s *Server) initLeafNodeSmapAndSendSubs(c *client) {
subs := _subs[:0]
ims := []string{}
// Hold the client lock otherwise there can be a race and miss some subs.
c.mu.Lock()
defer c.mu.Unlock()
acc.mu.RLock()
accName := acc.Name
accNTag := acc.nameTag
@@ -1956,7 +1960,6 @@ func (s *Server) initLeafNodeSmapAndSendSubs(c *client) {
}
// Now walk the results and add them to our smap
c.mu.Lock()
rc := c.leaf.remoteCluster
c.leaf.smap = make(map[string]int32)
for _, sub := range subs {
@@ -2022,7 +2025,6 @@ func (s *Server) initLeafNodeSmapAndSendSubs(c *client) {
c.mu.Unlock()
})
}
c.mu.Unlock()
}
// updateInterestForAccountOnGateway called from gateway code when processing RS+ and RS-.