mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-17 11:24:44 -07:00
hitting an account limit left an outgoing leaf node conn in bad state (#2715)
since no error was traced or the connection closed, subscriptions where not forwarded Signed-off-by: Matthias Hanel <mh@synadia.com>
This commit is contained in:
@@ -2527,7 +2527,15 @@ func (s *Server) leafNodeFinishConnectProcess(c *client) {
|
||||
c.mu.Unlock()
|
||||
|
||||
// Make sure we register with the account here.
|
||||
c.registerWithAccount(acc)
|
||||
if err := c.registerWithAccount(acc); err != nil {
|
||||
if err == ErrTooManyAccountConnections {
|
||||
c.maxAccountConnExceeded()
|
||||
return
|
||||
}
|
||||
c.Errorf("Registering leaf with account %s resulted in error: %v", acc.Name, err)
|
||||
c.closeConnection(ProtocolViolation)
|
||||
return
|
||||
}
|
||||
s.addLeafNodeConnection(c, _EMPTY_, _EMPTY_, false)
|
||||
s.initLeafNodeSmapAndSendSubs(c)
|
||||
if sendSysConnectEvent {
|
||||
|
||||
Reference in New Issue
Block a user