mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-17 11:24:44 -07:00
Merge branch 'main' into dev
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -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-.
|
||||
|
||||
Reference in New Issue
Block a user