You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by dw...@apache.org on 2022/03/10 10:04:26 UTC
[flink] branch release-1.13 updated: [FLINK-15550][runtime] Debug logging for TaskTest
This is an automated email from the ASF dual-hosted git repository.
dwysakowicz pushed a commit to branch release-1.13
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.13 by this push:
new 98c20ce [FLINK-15550][runtime] Debug logging for TaskTest
98c20ce is described below
commit 98c20ced2d5e514a967feedbc51c1570c22c91be
Author: Anton Kalashnikov <ka...@yandex.ru>
AuthorDate: Fri Mar 4 17:04:57 2022 +0100
[FLINK-15550][runtime] Debug logging for TaskTest
(cherry picked from commit 16e9b7325881b45741f3591f73a7b7bcfd39322b)
---
.../apache/flink/runtime/taskmanager/TaskTest.java | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskTest.java
index c4e8ecd..49a1cd5 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskTest.java
@@ -53,6 +53,8 @@ import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.annotation.Nonnull;
@@ -103,6 +105,11 @@ public class TaskTest extends TestLogger {
public void setup() {
awaitLatch = new OneShotLatch();
triggerLatch = new OneShotLatch();
+ // Logging is only for debugging FLINK-15550.
+ log.info(
+ "Preparing trigger latch, {}, isTriggered = {}",
+ triggerLatch,
+ triggerLatch.isTriggered());
shuffleEnvironment = new NettyShuffleEnvironmentBuilder().build();
}
@@ -595,6 +602,7 @@ public class TaskTest extends TestLogger {
awaitLatch.await();
task.failExternally(new Exception("external"));
+ assertFalse(triggerLatch.isTriggered());
assertEquals(ExecutionState.FAILED, task.getExecutionState());
// Either we cause the CancelTaskException or the TaskCanceler
@@ -1281,13 +1289,23 @@ public class TaskTest extends TestLogger {
/** {@link AbstractInvokable} which throws {@link CancelTaskException} on invoke. */
public static final class InvokableWithCancelTaskExceptionInInvoke extends AbstractInvokable {
+ static final Logger LOG = LoggerFactory.getLogger(InvokableWithExceptionOnTrigger.class);
+
public InvokableWithCancelTaskExceptionInInvoke(Environment environment) {
super(environment);
}
@Override
public void invoke() {
- awaitTriggerLatch();
+ // Logging and try-catch block are only for debugging FLINK-15550.
+ LOG.info("Await for {}, isTriggered = {}", triggerLatch, triggerLatch.isTriggered());
+ try {
+ awaitTriggerLatch();
+ } catch (Throwable ex) {
+ LOG.error("Fail on awaiting trigger latch", ex);
+
+ throw ex;
+ }
throw new CancelTaskException();
}