adoroszlai commented on code in PR #10731:
URL: https://github.com/apache/ozone/pull/10731#discussion_r3564407156


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -759,11 +760,17 @@ public Response completeMultipartUpload(
     final String uploadID = queryParams().get(QueryParams.UPLOAD_ID, "");
     long startNanos = Time.monotonicNowNanos();
     S3GAction s3GAction = S3GAction.COMPLETE_MULTIPART_UPLOAD;
+    List<CompleteMultipartUploadRequest.Part> partList =
+        multipartUploadRequest.getPartList();
+
+    // Reject an empty part list before contacting OM.
+    if (partList == null || partList.isEmpty()) {
+      throw newError(MALFORMED_XML, key);
+    }
+
     OzoneVolume volume = getVolume();

Review Comment:
   Please move this inside the `try` below, to ensure audit log reflects the 
failure.



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