Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public enum StandardErrorCode
REMOTE_TASK_MISMATCH(0x0001_0008, INTERNAL_ERROR),
SERVER_SHUTTING_DOWN(0x0001_0009, INTERNAL_ERROR),
FUNCTION_IMPLEMENTATION_MISSING(0x0001_000A, INTERNAL_ERROR),
REMOTE_BUFFER_CLOSE_FAILED(0x0001_000B, INTERNAL_ERROR),
REMOTE_BUFFER_CLOSE_FAILED(0x0001_000B, INTERNAL_ERROR, true),
SERVER_STARTING_UP(0x0001_000C, INTERNAL_ERROR),
FUNCTION_IMPLEMENTATION_ERROR(0x0001_000D, INTERNAL_ERROR),
INVALID_PROCEDURE_DEFINITION(0x0001_000E, INTERNAL_ERROR),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
*/
package com.facebook.presto.tests;

import com.facebook.airlift.log.Logger;
import com.facebook.presto.Session;
import com.facebook.presto.common.ErrorCode;
import com.facebook.presto.execution.TaskManager;
import com.facebook.presto.server.BasicQueryInfo;
import com.facebook.presto.server.testing.TestingPrestoServer;
import com.facebook.presto.tpch.TpchPlugin;
import com.facebook.presto.transaction.TransactionInfo;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
Expand All @@ -30,10 +33,12 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import static com.facebook.airlift.testing.Assertions.assertLessThanOrEqual;
import static com.facebook.presto.execution.QueryState.FINISHED;
import static com.facebook.presto.testing.TestingSession.testSessionBuilder;
import static java.lang.String.format;
import static java.util.concurrent.Executors.newCachedThreadPool;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.testng.Assert.assertEquals;
Expand All @@ -42,6 +47,7 @@
@Test(singleThreaded = true)
public class TestBrutalShutdown
{
private static final Logger LOG = Logger.get(TestBrutalShutdown.class);
private static final long SHUTDOWN_TIMEOUT_MILLIS = 600_000;
private static final Session TINY_SESSION = testSessionBuilder()
.setCatalog("tpch")
Expand Down Expand Up @@ -80,6 +86,13 @@ public void testQueryRetryOnShutdown()
totalSuccessfulQueries++;
}
}
if (totalQueries != totalSuccessfulQueries) {
LOG.error(Joiner.on("\n").join(queryInfos.stream()
.filter(queryInfo -> queryInfo.getState() != FINISHED)
.map(queryInfo -> format("query %s should have been successful but is in state: %s. Error: %s, retriable: %s",
queryInfo.getQueryId(), queryInfo.getState(), queryInfo.getErrorCode(), Optional.ofNullable(queryInfo.getErrorCode()).map(ErrorCode::isRetriable).orElse(null)))
.iterator()));
}
assertEquals(totalSuccessfulQueries, totalQueries);
}
}
Expand Down
Loading