Search in sources :

Example 1 with PrestoQueryException

use of com.facebook.presto.verifier.framework.PrestoQueryException in project presto by prestodb.

the class PrestoExceptionClassifier method shouldResubmit.

public boolean shouldResubmit(Throwable throwable) {
    if (!(throwable instanceof PrestoQueryException)) {
        return false;
    }
    PrestoQueryException queryException = (PrestoQueryException) throwable;
    Optional<ErrorCodeSupplier> errorCode = queryException.getErrorCode();
    return errorCode.isPresent() && (resubmittedErrors.contains(errorCode.get()) || conditionalResubmittedErrors.stream().anyMatch(matcher -> matcher.matches(errorCode.get(), queryException.getQueryStage(), queryException.getMessage())));
}
Also used : ThrottlingException(com.facebook.presto.verifier.framework.ThrottlingException) HIVE_CURSOR_ERROR(com.facebook.presto.hive.HiveErrorCode.HIVE_CURSOR_ERROR) TimeoutException(java.util.concurrent.TimeoutException) SERVER_SHUTTING_DOWN(com.facebook.presto.spi.StandardErrorCode.SERVER_SHUTTING_DOWN) CASE_INSENSITIVE(java.util.regex.Pattern.CASE_INSENSITIVE) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) HIVE_METASTORE_ERROR(com.facebook.presto.hive.HiveErrorCode.HIVE_METASTORE_ERROR) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) ABANDONED_TASK(com.facebook.presto.spi.StandardErrorCode.ABANDONED_TASK) EXCEEDED_TIME_LIMIT(com.facebook.presto.spi.StandardErrorCode.EXCEEDED_TIME_LIMIT) Functions.identity(com.google.common.base.Functions.identity) ImmutableSet(com.google.common.collect.ImmutableSet) HIVE_WRITER_DATA_ERROR(com.facebook.presto.hive.HiveErrorCode.HIVE_WRITER_DATA_ERROR) REMOTE_TASK_MISMATCH(com.facebook.presto.spi.StandardErrorCode.REMOTE_TASK_MISMATCH) HIVE_TOO_MANY_OPEN_PARTITIONS(com.facebook.presto.hive.HiveErrorCode.HIVE_TOO_MANY_OPEN_PARTITIONS) Set(java.util.Set) NO_NODES_AVAILABLE(com.facebook.presto.spi.StandardErrorCode.NO_NODES_AVAILABLE) PAGE_TRANSPORT_TIMEOUT(com.facebook.presto.spi.StandardErrorCode.PAGE_TRANSPORT_TIMEOUT) EOFException(java.io.EOFException) UncheckedIOException(java.io.UncheckedIOException) Objects(java.util.Objects) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap) TOO_MANY_REQUESTS_FAILED(com.facebook.presto.spi.StandardErrorCode.TOO_MANY_REQUESTS_FAILED) StandardErrorCode(com.facebook.presto.spi.StandardErrorCode) HIVE_TABLE_DROPPED_DURING_QUERY(com.facebook.presto.hive.HiveErrorCode.HIVE_TABLE_DROPPED_DURING_QUERY) Optional(java.util.Optional) ErrorCodeSupplier(com.facebook.presto.spi.ErrorCodeSupplier) THRIFT_SERVICE_CONNECTION_ERROR(com.facebook.presto.connector.thrift.ThriftErrorCode.THRIFT_SERVICE_CONNECTION_ERROR) Pattern(java.util.regex.Pattern) MoreObjects.toStringHelper(com.google.common.base.MoreObjects.toStringHelper) HIVE_FILE_NOT_FOUND(com.facebook.presto.hive.HiveErrorCode.HIVE_FILE_NOT_FOUND) TEST_MAIN(com.facebook.presto.verifier.framework.QueryStage.TEST_MAIN) JDBC_ERROR(com.facebook.presto.plugin.jdbc.JdbcErrorCode.JDBC_ERROR) ThriftErrorCode(com.facebook.presto.connector.thrift.ThriftErrorCode) ClusterConnectionException(com.facebook.presto.verifier.framework.ClusterConnectionException) HIVE_PARTITION_DROPPED_DURING_QUERY(com.facebook.presto.hive.HiveErrorCode.HIVE_PARTITION_DROPPED_DURING_QUERY) HIVE_WRITER_CLOSE_ERROR(com.facebook.presto.hive.HiveErrorCode.HIVE_WRITER_CLOSE_ERROR) CLUSTER_OUT_OF_MEMORY(com.facebook.presto.spi.StandardErrorCode.CLUSTER_OUT_OF_MEMORY) HIVE_CANNOT_OPEN_SPLIT(com.facebook.presto.hive.HiveErrorCode.HIVE_CANNOT_OPEN_SPLIT) REMOTE_HOST_GONE(com.facebook.presto.spi.StandardErrorCode.REMOTE_HOST_GONE) SocketException(java.net.SocketException) SQLException(java.sql.SQLException) SocketTimeoutException(java.net.SocketTimeoutException) DESCRIBE(com.facebook.presto.verifier.framework.QueryStage.DESCRIBE) Objects.requireNonNull(java.util.Objects.requireNonNull) TEST_SETUP(com.facebook.presto.verifier.framework.QueryStage.TEST_SETUP) THRIFT_SERVICE_GENERIC_REMOTE_ERROR(com.facebook.presto.connector.thrift.ThriftErrorCode.THRIFT_SERVICE_GENERIC_REMOTE_ERROR) PAGE_TRANSPORT_ERROR(com.facebook.presto.spi.StandardErrorCode.PAGE_TRANSPORT_ERROR) HIVE_PARTITION_OFFLINE(com.facebook.presto.hive.HiveErrorCode.HIVE_PARTITION_OFFLINE) SERVER_STARTING_UP(com.facebook.presto.spi.StandardErrorCode.SERVER_STARTING_UP) JdbcErrorCode(com.facebook.presto.plugin.jdbc.JdbcErrorCode) ABANDONED_QUERY(com.facebook.presto.spi.StandardErrorCode.ABANDONED_QUERY) PrestoQueryException(com.facebook.presto.verifier.framework.PrestoQueryException) QueryException(com.facebook.presto.verifier.framework.QueryException) HIVE_FILESYSTEM_ERROR(com.facebook.presto.hive.HiveErrorCode.HIVE_FILESYSTEM_ERROR) REMOTE_TASK_ERROR(com.facebook.presto.spi.StandardErrorCode.REMOTE_TASK_ERROR) SYNTAX_ERROR(com.facebook.presto.spi.StandardErrorCode.SYNTAX_ERROR) ADMINISTRATIVELY_PREEMPTED(com.facebook.presto.spi.StandardErrorCode.ADMINISTRATIVELY_PREEMPTED) HiveErrorCode(com.facebook.presto.hive.HiveErrorCode) SparkErrorCode(com.facebook.presto.spark.SparkErrorCode) CONTROL_SETUP(com.facebook.presto.verifier.framework.QueryStage.CONTROL_SETUP) HIVE_WRITER_OPEN_ERROR(com.facebook.presto.hive.HiveErrorCode.HIVE_WRITER_OPEN_ERROR) QueryStage(com.facebook.presto.verifier.framework.QueryStage) PrestoQueryException(com.facebook.presto.verifier.framework.PrestoQueryException) ErrorCodeSupplier(com.facebook.presto.spi.ErrorCodeSupplier)

Example 2 with PrestoQueryException

use of com.facebook.presto.verifier.framework.PrestoQueryException in project presto by prestodb.

the class TestPrestoExceptionClassifier method assertPrestoQueryException.

private void assertPrestoQueryException(QueryException queryException, Optional<ErrorCodeSupplier> errorCode, boolean retryable, QueryActionStats queryActionStats, QueryStage queryStage) {
    assertTrue(queryException instanceof PrestoQueryException);
    assertEquals(queryException.getQueryStage(), queryStage);
    PrestoQueryException exception = (PrestoQueryException) queryException;
    assertEquals(exception.getErrorCode(), errorCode);
    assertEquals(exception.isRetryable(), retryable);
    assertEquals(exception.getQueryActionStats(), queryActionStats);
}
Also used : PrestoQueryException(com.facebook.presto.verifier.framework.PrestoQueryException)

Aggregations

PrestoQueryException (com.facebook.presto.verifier.framework.PrestoQueryException)2 ThriftErrorCode (com.facebook.presto.connector.thrift.ThriftErrorCode)1 THRIFT_SERVICE_CONNECTION_ERROR (com.facebook.presto.connector.thrift.ThriftErrorCode.THRIFT_SERVICE_CONNECTION_ERROR)1 THRIFT_SERVICE_GENERIC_REMOTE_ERROR (com.facebook.presto.connector.thrift.ThriftErrorCode.THRIFT_SERVICE_GENERIC_REMOTE_ERROR)1 HiveErrorCode (com.facebook.presto.hive.HiveErrorCode)1 HIVE_CANNOT_OPEN_SPLIT (com.facebook.presto.hive.HiveErrorCode.HIVE_CANNOT_OPEN_SPLIT)1 HIVE_CURSOR_ERROR (com.facebook.presto.hive.HiveErrorCode.HIVE_CURSOR_ERROR)1 HIVE_FILESYSTEM_ERROR (com.facebook.presto.hive.HiveErrorCode.HIVE_FILESYSTEM_ERROR)1 HIVE_FILE_NOT_FOUND (com.facebook.presto.hive.HiveErrorCode.HIVE_FILE_NOT_FOUND)1 HIVE_METASTORE_ERROR (com.facebook.presto.hive.HiveErrorCode.HIVE_METASTORE_ERROR)1 HIVE_PARTITION_DROPPED_DURING_QUERY (com.facebook.presto.hive.HiveErrorCode.HIVE_PARTITION_DROPPED_DURING_QUERY)1 HIVE_PARTITION_OFFLINE (com.facebook.presto.hive.HiveErrorCode.HIVE_PARTITION_OFFLINE)1 HIVE_TABLE_DROPPED_DURING_QUERY (com.facebook.presto.hive.HiveErrorCode.HIVE_TABLE_DROPPED_DURING_QUERY)1 HIVE_TOO_MANY_OPEN_PARTITIONS (com.facebook.presto.hive.HiveErrorCode.HIVE_TOO_MANY_OPEN_PARTITIONS)1 HIVE_WRITER_CLOSE_ERROR (com.facebook.presto.hive.HiveErrorCode.HIVE_WRITER_CLOSE_ERROR)1 HIVE_WRITER_DATA_ERROR (com.facebook.presto.hive.HiveErrorCode.HIVE_WRITER_DATA_ERROR)1 HIVE_WRITER_OPEN_ERROR (com.facebook.presto.hive.HiveErrorCode.HIVE_WRITER_OPEN_ERROR)1 JdbcErrorCode (com.facebook.presto.plugin.jdbc.JdbcErrorCode)1 JDBC_ERROR (com.facebook.presto.plugin.jdbc.JdbcErrorCode.JDBC_ERROR)1 SparkErrorCode (com.facebook.presto.spark.SparkErrorCode)1