noseglid commented on code in PR #37751:
URL: https://github.com/apache/beam/pull/37751#discussion_r3279478198


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/datastore/DatastoreV1.java:
##########
@@ -2340,6 +2340,7 @@ public void processElement(ProcessContext c, 
BoundedWindow window) throws Except
 
       if (!uniqueMutationKeys.add(getKey(mutation))) {
         flushBatch(contextAdapter);
+        uniqueMutationKeys.add(getKey(mutation));

Review Comment:
   I guess there's a risk a conflicting key was added after the flush, and 
before this add happens.
   
   To truly address that we can't just have another check because it might 
happen. Instead I think we should loop until we successfully add this mutation 
(and flush every time we fail). I'm happy to add that if you agree.



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