mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-14 10:10:42 -07:00
Avoid blocking when holding account lock.
Signed-off-by: Matthias Hanel <mh@synadia.com>
This commit is contained in:
@@ -1185,7 +1185,14 @@ func (s *Server) sendAccConnsUpdate(a *Account, subj ...string) {
|
||||
}
|
||||
}
|
||||
for _, sub := range subj {
|
||||
sendQ <- &pubMsg{nil, sub, _EMPTY_, &m.Server, &m, false}
|
||||
msg := &pubMsg{nil, sub, _EMPTY_, &m.Server, &m, false}
|
||||
select {
|
||||
case sendQ <- msg:
|
||||
default:
|
||||
a.mu.Unlock()
|
||||
sendQ <- msg
|
||||
a.mu.Lock()
|
||||
}
|
||||
}
|
||||
a.mu.Unlock()
|
||||
s.mu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user