Avoid panics during shutdown routine (#8412)

pull/8414/head
Freddy 2020-07-30 11:11:10 -06:00 committed by GitHub
parent a4b373b333
commit f1e8addbdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -958,15 +958,21 @@ func (s *Server) Shutdown() error {
} }
// Close the connection pool // Close the connection pool
s.connPool.Shutdown() if s.connPool != nil {
s.connPool.Shutdown()
}
s.acls.Close() if s.acls != nil {
s.acls.Close()
}
if s.config.NotifyShutdown != nil { if s.config.NotifyShutdown != nil {
s.config.NotifyShutdown() s.config.NotifyShutdown()
} }
s.fsm.State().Abandon() if s.fsm != nil {
s.fsm.State().Abandon()
}
return nil return nil
} }