chamikaramj commented on code in PR #22138:
URL: https://github.com/apache/beam/pull/22138#discussion_r921730603


##########
sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/util/GcsUtil.java:
##########
@@ -897,6 +898,35 @@ public void onFailure(GoogleJsonError e, HttpHeaders 
responseHeaders) throws IOE
         } else {
           throw new FileNotFoundException(from.toString());
         }
+      } else if (e.getCode() == 403
+          && e.getErrors().size() == 1
+          && e.getErrors().get(0).getReason().equals("retentionPolicyNotMet")) 
{
+        List<StorageObjectOrIOException> srcAndDestObjects = 
getObjects(Arrays.asList(from, to));
+        if (srcAndDestObjects
+            .get(0)

Review Comment:
   Are both the source and the destination guaranteed to exist at this point ?



##########
sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/util/GcsUtil.java:
##########
@@ -897,6 +898,35 @@ public void onFailure(GoogleJsonError e, HttpHeaders 
responseHeaders) throws IOE
         } else {
           throw new FileNotFoundException(from.toString());
         }
+      } else if (e.getCode() == 403
+          && e.getErrors().size() == 1
+          && e.getErrors().get(0).getReason().equals("retentionPolicyNotMet")) 
{
+        List<StorageObjectOrIOException> srcAndDestObjects = 
getObjects(Arrays.asList(from, to));
+        if (srcAndDestObjects
+            .get(0)
+            .storageObject()
+            .getMd5Hash()
+            .equals(srcAndDestObjects.get(1).storageObject().getMd5Hash())) {

Review Comment:
   Please make sure that this does not pass trivially due to default values 
matching.



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

Reply via email to