use of org.apache.flink.runtime.executiongraph.failover.flip1.FailureHandlingResult in project flink-mirror by flink-ci.
the class FailureHandlingResultSnapshotTest method testLocalFailureHandlingResultSnapshotCreation.
@Test
public void testLocalFailureHandlingResultSnapshotCreation() {
final ExecutionVertex rootCauseExecutionVertex = extractExecutionVertex(0);
final Throwable rootCause = new RuntimeException("Expected exception: root cause");
final ExecutionVertex otherFailedExecutionVertex = extractExecutionVertex(1);
final Throwable otherFailure = new IllegalStateException("Expected exception: other failure");
final long rootCauseTimestamp = triggerFailure(rootCauseExecutionVertex, rootCause);
triggerFailure(otherFailedExecutionVertex, otherFailure);
final FailureHandlingResult failureHandlingResult = FailureHandlingResult.restartable(rootCauseExecutionVertex.getID(), rootCause, rootCauseTimestamp, StreamSupport.stream(executionGraph.getAllExecutionVertices().spliterator(), false).map(ExecutionVertex::getID).collect(Collectors.toSet()), 0L, false);
final FailureHandlingResultSnapshot testInstance = FailureHandlingResultSnapshot.create(failureHandlingResult, this::getLatestExecution);
assertThat(testInstance.getRootCause(), is(rootCause));
assertThat(testInstance.getTimestamp(), is(rootCauseTimestamp));
assertThat(testInstance.getRootCauseExecution().isPresent(), is(true));
assertThat(testInstance.getRootCauseExecution().get(), is(rootCauseExecutionVertex.getCurrentExecutionAttempt()));
assertThat(testInstance.getConcurrentlyFailedExecution(), IsIterableContainingInOrder.contains(otherFailedExecutionVertex.getCurrentExecutionAttempt()));
}
use of org.apache.flink.runtime.executiongraph.failover.flip1.FailureHandlingResult in project flink by splunk.
the class DefaultScheduler method handleTaskFailure.
private void handleTaskFailure(final ExecutionVertexID executionVertexId, @Nullable final Throwable error) {
final long timestamp = System.currentTimeMillis();
setGlobalFailureCause(error, timestamp);
notifyCoordinatorsAboutTaskFailure(executionVertexId, error);
final FailureHandlingResult failureHandlingResult = executionFailureHandler.getFailureHandlingResult(executionVertexId, error, timestamp);
maybeRestartTasks(failureHandlingResult);
}
use of org.apache.flink.runtime.executiongraph.failover.flip1.FailureHandlingResult in project flink by splunk.
the class DefaultScheduler method handleGlobalFailure.
@Override
public void handleGlobalFailure(final Throwable error) {
final long timestamp = System.currentTimeMillis();
setGlobalFailureCause(error, timestamp);
log.info("Trying to recover from a global failure.", error);
final FailureHandlingResult failureHandlingResult = executionFailureHandler.getGlobalFailureHandlingResult(error, timestamp);
maybeRestartTasks(failureHandlingResult);
}
use of org.apache.flink.runtime.executiongraph.failover.flip1.FailureHandlingResult in project flink by apache.
the class DefaultScheduler method handleTaskFailure.
private void handleTaskFailure(final ExecutionVertexID executionVertexId, @Nullable final Throwable error) {
final long timestamp = System.currentTimeMillis();
setGlobalFailureCause(error, timestamp);
notifyCoordinatorsAboutTaskFailure(executionVertexId, error);
final FailureHandlingResult failureHandlingResult = executionFailureHandler.getFailureHandlingResult(executionVertexId, error, timestamp);
maybeRestartTasks(failureHandlingResult);
}
use of org.apache.flink.runtime.executiongraph.failover.flip1.FailureHandlingResult in project flink by apache.
the class FailureHandlingResultSnapshotTest method testRootCauseVertexNotFailed.
@Test(expected = IllegalArgumentException.class)
public void testRootCauseVertexNotFailed() {
final ExecutionVertex rootCauseExecutionVertex = extractExecutionVertex(0);
final FailureHandlingResult failureHandlingResult = FailureHandlingResult.restartable(rootCauseExecutionVertex.getID(), new RuntimeException("Expected exception: root cause"), System.currentTimeMillis(), StreamSupport.stream(executionGraph.getAllExecutionVertices().spliterator(), false).map(ExecutionVertex::getID).collect(Collectors.toSet()), 0L, false);
FailureHandlingResultSnapshot.create(failureHandlingResult, this::getLatestExecution);
}
Aggregations