prestodb/presto · error · PrestoException
SERVER_SHUTTING_DOWN
SERVER_SHUTTING_DOWN
Error message
Server is shutting down
What it means
Thrown by HiveSplitManager's RejectedExecutionHandler when a task is submitted to the split-loading executor after the Presto server has begun shutting down and its thread pools reject new work. It signals the query cannot proceed because the coordinator/worker is going away.
Source
Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveSplitManager.java:1122
private static class ErrorCodedExecutor
implements Executor
{
private final Executor delegate;
private ErrorCodedExecutor(Executor delegate)
{
this.delegate = requireNonNull(delegate, "delegate is null");
}
@Override
public void execute(Runnable command)
{
try {
delegate.execute(command);
}
catch (RejectedExecutionException e) {
throw new PrestoException(SERVER_SHUTTING_DOWN, "Server is shutting down", e);
}
}
}
}
View on GitHub (pinned to 55bb57d202)
Solutions
- Wait for the server restart to complete and re-run the query.
- Enable graceful shutdown and drain active queries before stopping (e.g., shutdown timeout so queries finish).
- Use a coordinator with query retry/ha proxy so clients resubmit during rolling restarts.
Defensive patterns
Strategy: retry
Try / catch
try { runQuery(sql); } catch (PrestoException e) {
if (SERVER_SHUTTING_DOWN.toErrorCode().getCode() == e.getErrorCode().getCode()) {
retryWithBackoff(sql); // resubmit after server restart completes
} else { throw e; }
} Prevention
- Use graceful shutdown with drain so queries finish before workers stop
- Retry queries automatically during rolling deploys
- Schedule heavy queries away from deployment windows
When it happens
Trigger: Split loading tasks submitted via executor.execute() while the server is stopping; RejectedExecutionException from the underlying delegate executor is wrapped into SERVER_SHUTTING_DOWN.
Common situations: Deploying a new version or restarting Presto while queries run; server crash or SIGTERM during query execution; systemctl stop / graceful shutdown racing active queries.
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/730810ae0d60937c.
Report an issue: GitHub.