[s3] revert skip deletion error, since the error file was not found is already skipped on the side of the grpc function (#5760)

* revert skip deletion error, since the error file was not found is already skipped on the side of the grpc function

* fix response error

* fix test_lifecycle_get

* Revert "fix test_lifecycle_get"

This reverts commit 8f991bdcf9.
This commit is contained in:
Konstantin Lebedev 2024-07-10 20:47:43 +05:00 committed by GitHub
parent 182f6d00a9
commit 9c440d472c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,12 +30,10 @@ func (s3a *S3ApiServer) DeleteObjectHandler(w http.ResponseWriter, r *http.Reque
target := util.FullPath(fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, bucket, object))
dir, name := target.DirAndName()
s3a.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
err := s3a.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
err := doDeleteEntry(client, dir, name, true, false)
if err != nil {
// skip deletion error, usually the file is not found
return nil
if err := doDeleteEntry(client, dir, name, true, false); err != nil {
return err
}
if s3a.option.AllowEmptyFolder {
@ -53,6 +51,10 @@ func (s3a *S3ApiServer) DeleteObjectHandler(w http.ResponseWriter, r *http.Reque
return nil
})
if err != nil {
s3err.WriteErrorResponse(w, r, s3err.ErrInternalError)
return
}
w.WriteHeader(http.StatusNoContent)
}