Skip to content

Commit

Permalink
[FLINK-15550][runtime] Don't ignore the interruption for testCancelTa…
Browse files Browse the repository at this point in the history
…skExceptionAfterTaskMarkedFailed
  • Loading branch information
akalash authored and pnowojski committed Nov 2, 2021
1 parent 85fbeff commit 7635571
Showing 1 changed file with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1430,23 +1430,27 @@ public InvokableWithExceptionOnTrigger(Environment environment) {

@Override
public void invoke() {
awaitLatch.trigger();

// make sure that the interrupt call does not
// grab us out of the lock early
while (true) {
try {
triggerLatch.await();
break;
} catch (InterruptedException e) {
// fall through the loop
}
}
awaitTriggerLatch();

throw new RuntimeException("test");
}
}

private static void awaitTriggerLatch() {
awaitLatch.trigger();

// make sure that the interrupt call does not
// grab us out of the lock early
while (true) {
try {
triggerLatch.await();
break;
} catch (InterruptedException e) {
// fall through the loop
}
}
}

/** {@link AbstractInvokable} which throws {@link CancelTaskException} on invoke. */
public static final class InvokableWithCancelTaskExceptionInInvoke extends AbstractInvokable {
public InvokableWithCancelTaskExceptionInInvoke(Environment environment) {
Expand All @@ -1455,12 +1459,7 @@ public InvokableWithCancelTaskExceptionInInvoke(Environment environment) {

@Override
public void invoke() {
awaitLatch.trigger();

try {
triggerLatch.await();
} catch (Throwable ignored) {
}
awaitTriggerLatch();

throw new CancelTaskException();
}
Expand Down

0 comments on commit 7635571

Please sign in to comment.