priyeshkaratha commented on code in PR #10888:
URL: https://github.com/apache/ozone/pull/10888#discussion_r3683680348


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketCrudHandler.java:
##########
@@ -156,11 +156,11 @@ protected void 
deleteLifecycleConfiguration(S3RequestContext context, String buc
     try {
       context.getVolume().getBucket(bucketName).deleteLifecycleConfiguration();
     } catch (OMException ex) {
-      if (ex.getResult() == 
OMException.ResultCodes.LIFECYCLE_CONFIGURATION_NOT_FOUND) {
-        throw S3ErrorTable.newError(
-            S3ErrorTable.NO_SUCH_LIFECYCLE_CONFIGURATION, bucketName);
+      // DeleteBucketLifecycle is idempotent: deleting a missing config
+      // must still return 204, not 404 — same as normal key deletion.
+      if (ex.getResult() != 
OMException.ResultCodes.LIFECYCLE_CONFIGURATION_NOT_FOUND) {
+        throw ex;

Review Comment:
   It is better to throw exception using `S3ErrorTable.newError(bucketName, 
ex);` 
   
   ```suggestion
           throw S3ErrorTable.newError(bucketName, ex);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to