wombatu-kun commented on code in PR #19019:
URL: https://github.com/apache/hudi/pull/19019#discussion_r3425040852
##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/table/ITTestHoodieDataSource.java:
##########
@@ -3966,8 +3975,41 @@ private static boolean
isAcceptableTerminalFailure(Throwable e) {
if (msg != null && msg.contains("Stream is closed")) {
return true;
}
+ // The NPE twin of the "Stream is closed!" teardown race (cause #3 at
the call site):
+ // a NullPointerException whose own stack trace originates from
+ // ParquetColumnarRowSplitReader#readNextRowGroup, i.e.
reader.readNextRowGroup() ran on a
+ // null `reader` that ParquetColumnarRowSplitReader#close had just
nulled out. Scoped to
+ // that exact frame so genuine NPEs - and the legitimate
IOException("expecting more
+ // rows...") thrown from the same method - still fail the test.
+ if (isNullPointerException(cur) && readsNextRowGroup(cur)) {
+ return true;
+ }
cur = cur.getCause();
}
return false;
}
+
+ /**
+ * True for a real {@link NullPointerException} as well as one wrapped in
Flink's
+ * {@code SerializedThrowable} when the failure is propagated back from the
cluster (its
+ * {@code toString()} preserves the original {@code
java.lang.NullPointerException} prefix).
+ */
+ private static boolean isNullPointerException(Throwable t) {
+ return t instanceof NullPointerException
+ || t.toString().startsWith("java.lang.NullPointerException");
+ }
+
+ /**
+ * Whether {@code t}'s stack trace (preserved even through {@code
SerializedThrowable})
+ * contains a {@code ParquetColumnarRowSplitReader#readNextRowGroup} frame.
+ */
+ private static boolean readsNextRowGroup(Throwable t) {
Review Comment:
Done 85722780b0fa
--
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]