mirror of https://github.com/hashicorp/consul
Avoid panics during shutdown routine (#8412)
parent
a4b373b333
commit
f1e8addbdf
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue