voonhous commented on code in PR #19120:
URL: https://github.com/apache/hudi/pull/19120#discussion_r3602334072


##########
hudi-client/hudi-java-client/src/test/java/org/apache/hudi/client/common/TestMultipleHoodieJavaWriteClient.java:
##########
@@ -207,8 +208,14 @@ record -> {
               String startCommitTime = writer.startCommit();
               List<WriteStatus> s = 
writer.upsert(Collections.singletonList(record), startCommitTime);
 
-              writer.commit(startCommitTime, s);
-              LOGGER.info("Completed commit");
+              try {
+                writer.commit(startCommitTime, s);
+                LOGGER.info("Completed commit");
+              } catch (HoodieWriteConflictException e) {
+                // OCC conflict is expected when multiple writers operate 
concurrently on overlapping key ranges.
+                // The test verifies no deadlock occurs, not that every commit 
succeeds.
+                LOGGER.info("Write conflict on commit {}, expected OCC 
behavior: {}", startCommitTime, e.getMessage());
+              }
               synchronized (writerQueue) {

Review Comment:
   #19124 already landed this same OCC fix in master (with the `finally`), so I 
commandeered and rebased onto master to drop the duplicate. PR is now scoped to 
just the `TestJavaHoodieBackedMetadata` commit-time fix.



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