Skip to content

Commit

Permalink
Retry IOException: Error writing request body to server to fix the
Browse files Browse the repository at this point in the history
intermittent failure when uploading to gcs
  • Loading branch information
yihanzhen committed Jul 11, 2018
1 parent 71637ce commit 8e20b1c
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,13 @@ public static boolean isRetryable(Integer code, String reason, boolean idempoten

@InternalApi
public static boolean isRetryable(boolean idempotent, IOException exception) {
boolean exceptionIsRetryable = exception instanceof SocketTimeoutException
|| exception instanceof SocketException
|| (exception instanceof SSLHandshakeException
&& !(exception.getCause() instanceof CertificateException))
|| "insufficient data written".equals(exception.getMessage());
boolean exceptionIsRetryable =
exception instanceof SocketTimeoutException
|| exception instanceof SocketException
|| (exception instanceof SSLHandshakeException
&& !(exception.getCause() instanceof CertificateException))
|| "insufficient data written".equals(exception.getMessage())
|| "Error writing request body to server".equals(exception.getMessage());
return idempotent && exceptionIsRetryable;
}

Expand Down

0 comments on commit 8e20b1c

Please sign in to comment.