hevinhsu commented on code in PR #9110:
URL: https://github.com/apache/ozone/pull/9110#discussion_r2512649640
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -126,53 +126,33 @@ public Response get(
@DefaultValue("1000") @QueryParam("max-uploads") int maxUploads) throws
OS3Exception, IOException {
long startNanos = Time.monotonicNowNanos();
S3GAction s3GAction = S3GAction.GET_BUCKET;
Review Comment:
Nit: Maybe we can move this line to where the actual bucket processing
starts, for better readability — similar to how you declared s3GAction at the
beginning of the actual process block in `handleGetBucketAcl` and
`listMultipartUploads`.
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -193,11 +173,146 @@ public Response get(
throw ex;
}
- // The valid encodingType Values is "url"
+ // Return empty response if no keys found
+ ListObjectResponse emptyResponse = new ListObjectResponse();
+ emptyResponse.setName(bucketName);
+ emptyResponse.setKeyCount(0);
+ return Response.ok(emptyResponse).build();
Review Comment:
It seems you chose another approach to handle the `FILE_NOT_FOUND` case when
no key is found.
Previously, the exception was caught and the get bucket process continued,
ensuring the audit log was written afterward.
In your version, this logic is handled in a separate block that returns an
empty response, but it seems the audit log is not written in this path.
Maybe we should also log the audit entry here to align with the previous
behavior.
--
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]