mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Fix leaf connection missing LS+ sometimes
Signed-off-by: Waldemar Quevedo <wally@nats.io>
This commit is contained in:
committed by
Waldemar Quevedo
parent
2834142bdd
commit
9a9e84ea5c
@@ -1643,6 +1643,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
|
||||
@@ -1718,7 +1722,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 {
|
||||
@@ -1784,7 +1787,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