mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-17 03:24:40 -07:00
Fixes for race detections under GHA
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -1546,7 +1546,7 @@ func (c *client) processConnect(arg []byte) error {
|
||||
}
|
||||
} else if c.acc == nil {
|
||||
// By default register with the global account.
|
||||
c.registerWithAccount(srv.gacc)
|
||||
c.registerWithAccount(srv.globalAccount())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1095,6 +1095,7 @@ func (s *Server) reloadAuthorization() {
|
||||
// If account exist in latest config, "transfer" the account's
|
||||
// sublist and client map to the new account.
|
||||
acc.mu.RLock()
|
||||
newAcc.mu.Lock()
|
||||
if len(acc.clients) > 0 {
|
||||
newAcc.clients = make(map[*client]struct{}, len(acc.clients))
|
||||
for c := range acc.clients {
|
||||
@@ -1112,6 +1113,7 @@ func (s *Server) reloadAuthorization() {
|
||||
newAcc.imports.rrMap[k] = v
|
||||
}
|
||||
}
|
||||
newAcc.mu.Unlock()
|
||||
acc.mu.RUnlock()
|
||||
|
||||
// Check if current and new config of this account are same
|
||||
|
||||
Reference in New Issue
Block a user