github-actions[bot] commented on code in PR #41155:
URL: https://github.com/apache/beam/pull/41155#discussion_r4525306807


##########
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamEnumerableConverter.java:
##########
@@ -278,6 +278,9 @@ private static State waitUntilFinish(PipelineResult result, 
AtomicBoolean cancel
       State state = result.waitUntilFinish();
       checkNotCancelled(cancelFlag);
       return state;
+    } catch (RuntimeException e) {
+      checkNotCancelled(cancelFlag);

Review Comment:
   **🟢 Low**: Notice that `limitRun` (around lines 203-222) also calls 
`result.waitUntilFinish(Duration.standardSeconds(1))` in a loop and checks 
`checkNotCancelled(cancelFlag)` only after the loop exits normally. If 
`DirectRunner` throws the same `IllegalStateException` during teardown (for 
instance, if `result.cancel()` is invoked or another thread cancels), 
`limitRun` could similarly bypass `checkNotCancelled(cancelFlag)`. Consider 
applying the same `try / catch (RuntimeException e)` guard in `limitRun` (or 
calling `checkNotCancelled(cancelFlag)` with `e` attached as a suppressed 
exception).



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