Browse Source

[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.
pull/5512/merge
Konstantin Lebedev 6 months ago
committed by GitHub
parent
commit
9c440d472c
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 12
      weed/s3api/s3api_object_handlers_delete.go

12
weed/s3api/s3api_object_handlers_delete.go

@ -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)) target := util.FullPath(fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, bucket, object))
dir, name := target.DirAndName() 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 { if s3a.option.AllowEmptyFolder {
@ -53,6 +51,10 @@ func (s3a *S3ApiServer) DeleteObjectHandler(w http.ResponseWriter, r *http.Reque
return nil return nil
}) })
if err != nil {
s3err.WriteErrorResponse(w, r, s3err.ErrInternalError)
return
}
w.WriteHeader(http.StatusNoContent) w.WriteHeader(http.StatusNoContent)
} }

Loading…
Cancel
Save