arunpandianp commented on code in PR #40955:
URL: https://github.com/apache/beam/pull/40955#discussion_r4499387613
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/WorkCancellingException.java:
##########
@@ -36,8 +39,9 @@ public WorkCancellingException(Throwable cause) {
/** Returns whether an exception was caused by a {@link
WorkCancellingException}. */
public static boolean isWorkCancellingException(Throwable t) {
+ Set<Throwable> seen = Collections.newSetFromMap(new IdentityHashMap<>());
@Nullable Throwable throwable = t;
- while (throwable != null) {
+ while (throwable != null && seen.add(throwable)) {
Review Comment:
> do we actually have such cycles or is this more theoretical?
Theoretical. Updated to avoid allocations and extracted logic to a common
util.
--
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]