mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-05-03 21:17:49 +08:00
filer: retryable when error is not found
This commit is contained in:
parent
58dd880322
commit
aac45f3e89
@ -143,7 +143,11 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
|
|||||||
// glog.V(4).Infoln("read bytes", count, "error", err)
|
// glog.V(4).Infoln("read bytes", count, "error", err)
|
||||||
if err != nil || count < 0 {
|
if err != nil || count < 0 {
|
||||||
glog.V(3).Infof("read %s isNormalVolume %v error: %v", r.URL.Path, hasVolume, err)
|
glog.V(3).Infof("read %s isNormalVolume %v error: %v", r.URL.Path, hasVolume, err)
|
||||||
w.WriteHeader(http.StatusNotFound)
|
if err == storage.ErrorNotFound || err == storage.ErrorDeleted {
|
||||||
|
w.WriteHeader(http.StatusNotFound)
|
||||||
|
} else {
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if n.Cookie != cookie {
|
if n.Cookie != cookie {
|
||||||
|
@ -309,7 +309,7 @@ func ReadUrlAsStream(fileUrl string, cipherKey []byte, isContentGzipped bool, is
|
|||||||
}
|
}
|
||||||
defer CloseResponse(r)
|
defer CloseResponse(r)
|
||||||
if r.StatusCode >= 400 {
|
if r.StatusCode >= 400 {
|
||||||
retryable = r.StatusCode >= 500
|
retryable = r.StatusCode == http.StatusNotFound || r.StatusCode >= 500
|
||||||
return retryable, fmt.Errorf("%s: %s", fileUrl, r.Status)
|
return retryable, fmt.Errorf("%s: %s", fileUrl, r.Status)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user