Search in sources :

Example 6 with ExecutionFailureInfo

use of io.prestosql.execution.ExecutionFailureInfo in project hetu-core by openlookeng.

the class HttpRemoteTask method failTask.

/**
 * Move the task directly to the failed state if there was a failure in this task
 */
private void failTask(Throwable cause) {
    TaskStatus taskStatus = getTaskStatus();
    if (!taskStatus.getState().isDone()) {
        log.debug(cause, "Remote task %s failed with %s", taskStatus.getSelf(), cause);
    }
    ExecutionFailureInfo failureInfo = toFailure(cause);
    if (SystemSessionProperties.isSnapshotEnabled(session)) {
        if (isResumableFailure(failureInfo)) {
            // Determine if the failure can be recovered by resuming query from a previous checkpoing
            taskStatus = failWith(taskStatus, RESUMABLE_FAILURE, ImmutableList.of(failureInfo));
            taskStatusFetcher.updateTaskStatus(taskStatus);
            return;
        }
        log.debug(cause, "Snapshot: remote task %s failed with unresumable error %s", taskStatus.getSelf(), cause);
    }
    abort(failWith(taskStatus, FAILED, ImmutableList.of(failureInfo)));
}
Also used : TaskStatus(io.prestosql.execution.TaskStatus) ExecutionFailureInfo(io.prestosql.execution.ExecutionFailureInfo)

Aggregations

ExecutionFailureInfo (io.prestosql.execution.ExecutionFailureInfo)6 BasicQueryInfo (io.prestosql.server.BasicQueryInfo)2 ErrorCode (io.prestosql.spi.ErrorCode)2 PrestoException (io.prestosql.spi.PrestoException)2 SemanticErrorCode (io.prestosql.sql.analyzer.SemanticErrorCode)2 FailureInfo (io.prestosql.client.FailureInfo)1 QueryError (io.prestosql.client.QueryError)1 Failure (io.prestosql.execution.Failure)1 QueryState (io.prestosql.execution.QueryState)1 TaskStatus (io.prestosql.execution.TaskStatus)1 HostAddress (io.prestosql.spi.HostAddress)1 PrestoTransportException (io.prestosql.spi.PrestoTransportException)1 StandardErrorCode (io.prestosql.spi.StandardErrorCode)1 SemanticException (io.prestosql.sql.analyzer.SemanticException)1 Test (org.testng.annotations.Test)1