mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-17 03:24:40 -07:00
Cleanup use of s.opts and fixed some lock (deadlock/inversion) issues
One should not access s.opts directly but instead use s.getOpts(). Also, server lock needs to be released when performing an account lookup (since this may result in server lock being acquired). A function was calling s.LookupAccount under the client lock, which technically creates a lock inversion situation. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
@@ -695,7 +695,7 @@ func (s *Server) startLeafNodeAcceptLoop() {
|
||||
s.leafNodeInfo = info
|
||||
// Possibly override Host/Port and set IP based on Cluster.Advertise
|
||||
if err := s.setLeafNodeInfoHostPortAndIP(); err != nil {
|
||||
s.Fatalf("Error setting leafnode INFO with LeafNode.Advertise value of %s, err=%v", s.opts.LeafNode.Advertise, err)
|
||||
s.Fatalf("Error setting leafnode INFO with LeafNode.Advertise value of %s, err=%v", opts.LeafNode.Advertise, err)
|
||||
l.Close()
|
||||
s.mu.Unlock()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user