priyeshkaratha opened a new pull request, #10848:
URL: https://github.com/apache/ozone/pull/10848

   ## What changes were proposed in this pull request?
   
   `BucketCrudHandler.putBucketLifecycleConfiguration()` was catching 
OMException, but it only re-threw the exception for `ACCESS_DENIED` and 
`INVALID_REQUEST`. If any other error occurred such as `QUOTA_EXCEEDED`, 
`NOT_SUPPORTED_OPERATION`, or an unexpected internal OM error, then the 
exception was swallowed. The method then returned Response.ok().build(), 
causing the client to receive an incorrect HTTP 200 success response even 
though the operation had actually failed.
   
   Other S3 gateway handlers don't behave this way. They simply convert every 
OMException into the appropriate S3 error by calling
   
   ```
   } catch (OMException ex) {
     throw S3ErrorTable.newError(bucketName, ex);
   }
   ```
   
   This change makes BucketCrudHandler follow the same pattern. 
S3ErrorTable.newError(bucketName, ex) translates the OM error into the correct 
S3 response. For example, `QUOTA_EXCEEDED` becomes a 403 response, while 
unexpected errors become InternalError (HTTP 500). `ACCESS_DENIED` and 
`INVALID_REQUEST` continue to behave exactly as before, but now the original 
exception is also preserved as the cause, making audit logs and stack traces 
more useful and consistent with the improvements from HDDS-15000.
   
   ## What is the link to the Apache JIRA
   
   HDDS-15940
   
   ## How was this patch tested?
   
   Tested using added test cases and existing unit test cases.
   


-- 
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