Close database connections last on shutdown (#11683)

The job workers and cluster discovery components require access to the
database during shutdown. To avoid issues, we leave the database open
until the last step of the shutdown process.
This commit is contained in:
Eli Young
2019-07-23 00:41:11 -07:00
committed by George Goldberg
parent fe8a0f6485
commit f4ef9cab5b

View File

@@ -332,10 +332,6 @@ func (s *Server) Shutdown() error {
s.StopHTTPServer()
s.WaitForGoroutines()
if s.Store != nil {
s.Store.Close()
}
if s.htmlTemplateWatcher != nil {
s.htmlTemplateWatcher.Close()
}
@@ -358,6 +354,10 @@ func (s *Server) Shutdown() error {
s.Jobs.StopSchedulers()
}
if s.Store != nil {
s.Store.Close()
}
mlog.Info("Server stopped")
return nil
}