Skip to content
Permalink
Browse files
fix: retry SSLException (#183)
  • Loading branch information
frankyn committed Mar 16, 2020
1 parent 4b91692 commit 775a84877ef69d22ca7a4392edd0d3680df2256e
Showing with 3 additions and 0 deletions.
  1. +3 −0 google-cloud-core/src/main/java/com/google/cloud/BaseServiceException.java
@@ -26,6 +26,7 @@
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;

/** Base class for all service exceptions. */
@@ -256,6 +257,8 @@ public static boolean isRetryable(boolean idempotent, IOException exception) {
boolean exceptionIsRetryable =
exception instanceof SocketTimeoutException
|| exception instanceof SocketException
|| (exception instanceof SSLException
&& exception.getMessage().contains("Connection has been shutdown: "))
|| (exception instanceof SSLHandshakeException
&& !(exception.getCause() instanceof CertificateException))
|| "insufficient data written".equals(exception.getMessage())

0 comments on commit 775a848

Please sign in to comment.