From 9c440d472c97d88efc92d6c5956306d418cfa3ce Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> Date: Wed, 10 Jul 2024 20:47:43 +0500 Subject: [PATCH] [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 8f991bdcf93d9a13c7787988173713ad1a263bae. --- weed/s3api/s3api_object_handlers_delete.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/weed/s3api/s3api_object_handlers_delete.go b/weed/s3api/s3api_object_handlers_delete.go index 43849bb07..7656b9d38 100644 --- a/weed/s3api/s3api_object_handlers_delete.go +++ b/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)) 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) }