davidradl commented on code in PR #27186:
URL: https://github.com/apache/flink/pull/27186#discussion_r2490223548
##########
flink-core/src/main/java/org/apache/flink/util/SerializedThrowable.java:
##########
@@ -141,15 +141,23 @@ public String getFullStringifiedStackTrace() {
return fullStringifiedStackTrace;
}
- private void addAllSuppressed(Throwable[] suppressed) {
+ /**
+ * Add all suppressed exceptions to this exception.
+ *
+ * @param suppressed The suppressed exceptions to add.
+ * @param alreadySeen The set of exceptions that have already been seen.
+ */
+ private void addAllSuppressed(Throwable[] suppressed, Set<Throwable>
alreadySeen) {
for (Throwable s : suppressed) {
- SerializedThrowable serializedThrowable;
- if (s instanceof SerializedThrowable) {
- serializedThrowable = (SerializedThrowable) s;
- } else {
- serializedThrowable = new SerializedThrowable(s);
+ if (alreadySeen.add(s)) {
Review Comment:
I know this is draught - it would be worth checking if the throwable is
already seen before doing any logic to consider adding it.
--
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]