storage: Return errDiskNotFound when a peer is during shutdown (#15868)

This commit is contained in:
Anis Elleuch 2022-10-18 21:50:46 +01:00 committed by GitHub
parent bd3dfad8b9
commit 0506d9e83d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@ import (
"errors"
"fmt"
"io"
"net/http"
"net/url"
"path"
"strconv"
@ -48,7 +49,10 @@ func isNetworkError(err error) bool {
if nerr, ok := err.(*rest.NetworkError); ok {
return xnet.IsNetworkOrHostDown(nerr.Err, false)
}
return false
// A peer node can be in shut down phase and proactively
// return 503 server closed error,consider it as an offline node
return err.Error() == http.ErrServerClosed.Error()
}
// Converts network error to storageErr. This function is