close disco before holder

This commit is contained in:
Kuba Podgórski 2021-01-14 17:35:30 +01:00
parent 2713be9329
commit 0e4a7a29fb

View file

@ -684,10 +684,13 @@ func (s *Server) Close() error {
// Notify goroutines to stop.
close(s.closing)
s.wg.Wait()
var errh, errd error
var errhs error
var errc error
if s.disCo != nil {
errd = s.disCo.Close()
}
if s.cluster != nil {
errc = s.cluster.close()
}
@ -701,9 +704,6 @@ func (s *Server) Close() error {
s.snapshotQueue = nil
}
if s.disCo != nil {
errd = s.disCo.Close()
}
// prefer to return holder error over cluster
// error. This order is somewhat arbitrary. It would be better if we had
// some way to combine all the errors, but probably not important enough to