Skip to content

Commit

Permalink
Add a new error code for buffer delete failures
Browse files Browse the repository at this point in the history
  • Loading branch information
nileema committed Oct 9, 2015
1 parent 24191c4 commit 1d64602
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import com.facebook.presto.spi.Page;
import com.facebook.presto.spi.PrestoException;
import com.facebook.presto.spi.StandardErrorCode;
import com.facebook.presto.spi.block.BlockEncodingSerde;
import com.google.common.base.Stopwatch;
import com.google.common.base.Throwables;
Expand Down Expand Up @@ -59,6 +58,7 @@
import static com.facebook.presto.client.PrestoHeaders.PRESTO_PAGE_TOKEN;
import static com.facebook.presto.operator.HttpPageBufferClient.PagesResponse.createEmptyPagesResponse;
import static com.facebook.presto.operator.HttpPageBufferClient.PagesResponse.createPagesResponse;
import static com.facebook.presto.spi.StandardErrorCode.REMOTE_BUFFER_CLOSE_FAILED;
import static com.facebook.presto.util.Failures.WORKER_NODE_ERROR;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.net.HttpHeaders.CONTENT_TYPE;
Expand Down Expand Up @@ -364,8 +364,8 @@ public void onFailure(Throwable t)
log.error("Request to delete %s failed %s", location, t);
Duration errorDuration = elapsedErrorDuration();
if (!(t instanceof PrestoException) && errorDuration.compareTo(minErrorDuration) > 0) {
String message = format("%s (%s - requests failed for %s)", WORKER_NODE_ERROR, location, errorDuration);
t = new PrestoException(StandardErrorCode.TOO_MANY_REQUESTS_FAILED, message, t);
String message = format("Error closing remote buffer (%s - requests failed for %s)", location, errorDuration);
t = new PrestoException(REMOTE_BUFFER_CLOSE_FAILED, message, t);
}
handleFailure(t);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public enum StandardErrorCode
WORKER_RESTARTED(0x0001_0008),
SERVER_SHUTTING_DOWN(0x0001_0009),
FUNCTION_IMPLEMENTATION_MISSING(0x0001_000A),
REMOTE_BUFFER_CLOSE_FAILED(0x0001_000B),

INSUFFICIENT_RESOURCES(0x0002_0000),
EXCEEDED_MEMORY_LIMIT(0x0002_0001),
Expand Down

0 comments on commit 1d64602

Please sign in to comment.