Skip to content

Commit

Permalink
Revert coordinator handling of out-of-task scope error categorization
Browse files Browse the repository at this point in the history
  • Loading branch information
tanjialiang authored and highker committed Apr 16, 2021
1 parent 33cdd9b commit 3513d07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.facebook.presto.server.smile.JsonResponseWrapper;
import com.facebook.presto.spi.ErrorCodeSupplier;
import com.facebook.presto.spi.PrestoException;
import com.facebook.presto.spi.StandardErrorCode;
import com.google.common.util.concurrent.FutureCallback;

import java.net.URI;
Expand Down Expand Up @@ -58,14 +57,9 @@ else if (response.getStatusCode() == HttpStatus.SERVICE_UNAVAILABLE.code()) {
callback.failed(new ServiceUnavailableException(uri));
}
else {
// Something is broken in the server or the client, so fail immediately (includes 500 errors)
Exception cause = response.getException();
String responseErrorCode = response.getHeader("X-Presto-Error-Code");
if (responseErrorCode != null) {
StandardErrorCode code = StandardErrorCode.valueOf(responseErrorCode);
cause = new PrestoException(code, createErrorMessage(response));
}
else if (cause == null) {
// Something is broken in the server or the client, so fail immediately (includes 500 errors)
if (cause == null) {
if (response.getStatusCode() == OK.code()) {
cause = new PrestoException(errorCode, format("Expected response from %s is empty", uri));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.facebook.presto.server.SimpleHttpResponseHandlerStats;
import com.facebook.presto.spi.ErrorCodeSupplier;
import com.facebook.presto.spi.PrestoException;
import com.facebook.presto.spi.StandardErrorCode;
import com.google.common.util.concurrent.FutureCallback;

import java.net.URI;
Expand Down Expand Up @@ -61,14 +60,9 @@ else if (response.getStatusCode() == HttpStatus.SERVICE_UNAVAILABLE.code()) {
callback.failed(new ServiceUnavailableException(uri));
}
else {
// Something is broken in the server or the client, so fail immediately (includes 500 errors)
Exception cause = response.getException();
String responseErrorCode = response.getHeader("X-Presto-Error-Code");
if (responseErrorCode != null) {
StandardErrorCode code = StandardErrorCode.valueOf(responseErrorCode);
cause = new PrestoException(code, createErrorMessage(response));
}
else if (cause == null) {
// Something is broken in the server or the client, so fail immediately (includes 500 errors)
if (cause == null) {
if (response.getStatusCode() == OK.code()) {
cause = new PrestoException(errorCode, format("Expected response from %s is empty", uri));
}
Expand Down

0 comments on commit 3513d07

Please sign in to comment.