hudi-agent commented on code in PR #19030:
URL: https://github.com/apache/hudi/pull/19030#discussion_r3425900414


##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/table/ITTestHoodieDataSource.java:
##########
@@ -126,6 +128,15 @@
  */
 @ExtendWith(FlinkMiniCluster.class)
 public class ITTestHoodieDataSource {
+  private static final Logger LOG = 
LoggerFactory.getLogger(ITTestHoodieDataSource.class);
+
+  // A streaming read collected via CollectTableSink is terminated by a forced 
SuccessException once it
+  // reaches its expected row count. A benign teardown race (see 
isAcceptableTerminalFailure) can instead
+  // close the source stream mid-read and terminate the job before all rows 
are emitted, leaving an
+  // incomplete result. Re-reading from the same (already committed) table is 
idempotent, so retry a few
+  // times before giving up. See fetchResultWithExpectedNum.

Review Comment:
   🤖 nit: the comment ends with `See fetchResultWithExpectedNum`, but the retry 
loop now lives in `submitAndFetchWithRetry` — could you update the reference so 
a future reader lands in the right place?
   
   <sub><i>- AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/table/ITTestHoodieDataSource.java:
##########
@@ -4012,4 +4048,28 @@ private static boolean 
containsReadNextRowGroupFrame(Throwable t) {
     }
     return false;
   }
+
+  /**
+   * Whether {@code e} (or any of its causes) is the normal {@link 
CollectSinkTableFactory.SuccessException}
+   * terminator (the happy path), as opposed to one of the tolerated 
teardown-race symptoms.
+   */
+  private static boolean isSuccessException(Throwable e) {
+    for (Throwable cur = e; cur != null; cur = cur.getCause()) {
+      if (cur instanceof CollectSinkTableFactory.SuccessException) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  /**
+   * Short description of {@code e}'s root cause, for logging which tolerated 
terminal failure fired.
+   */
+  private static String describeTerminalCause(Throwable e) {
+    Throwable root = e;
+    while (root.getCause() != null) {
+      root = root.getCause();
+    }
+    return root.getClass().getName() + ": " + root.getMessage();

Review Comment:
   🤖 nit: `getClass().getName()` produces the fully-qualified class name, which 
is a bit noisy in a log line — `getSimpleName()` would keep the output tighter 
and just as diagnosable here.
   
   <sub><i>- AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



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