You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/11/29 23:40:03 UTC

[GitHub] [beam] Abacn commented on a diff in pull request #24403: Fix multiple mutations affecting the same entity in Datastore write

Abacn commented on code in PR #24403:
URL: https://github.com/apache/beam/pull/24403#discussion_r1035389116


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/datastore/DatastoreV1.java:
##########
@@ -1579,7 +1579,7 @@ public void finishBundle() throws Exception {
      * @throws DatastoreException if the commit fails or IOException or InterruptedException if
      *     backing off between retries fails.
      */
-    private void flushBatch() throws DatastoreException, IOException, InterruptedException {
+    synchronized private void flushBatch() throws DatastoreException, IOException, InterruptedException {

Review Comment:
   As uniqueMutationKeys start working and flushBatch() is possible to get called, I am concerned about this apparently not thread-safe method. Within in bundle do we guarantee a processElement() being executed at the same time?



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org