HADOOP-18245. Extend KMS related exceptions that get mapped to ConnectException#4329
HADOOP-18245. Extend KMS related exceptions that get mapped to ConnectException#4329jojochuang merged 1 commit intoapache:trunkfrom
Conversation
jojochuang
left a comment
There was a problem hiding this comment.
+1
For future reference the stacktrace was:
22/04/13 16:25:55 WARN kms.LoadBalancingKMSClientProvider: KMS provider at [https://xxxx:16001/kms/v1/] threw an IOException:
javax.net.ssl.SSLException: readHandshakeRecord
at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1210)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:373)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:587)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:197)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:167)
Caused by: java.net.SocketException: Broken pipe (Write failed)
at java.net.SocketOutputStream.socketWrite0(Native Method)
at sun.security.ssl.SSLSocketOutputRecord.flush(SSLSocketOutputRecord.java:268)
at sun.security.ssl.HandshakeOutStream.flush(HandshakeOutStream.java:89)
at sun.security.ssl.Finished$T12FinishedProducer.onProduceFinished(Finished.java:399)
at sun.security.ssl.Finished$T12FinishedProducer.produce(Finished.java:374)
at sun.security.ssl.SSLHandshake.produce(SSLHandshake.java:420)
at sun.security.ssl.ServerHelloDone$ServerHelloDoneConsumer.consume(ServerHelloDone.java:182) <=======
at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:376)
at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1290)
at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1199)
... 58 more
|
🎊 +1 overall
This message was automatically generated. |
| // with the KMS server, creating a ConnectException from it, | ||
| // so that the FailoverOnNetworkExceptionRetry policy will retry | ||
| if (ioe instanceof SSLHandshakeException) { | ||
| if (ioe instanceof SSLException || ioe instanceof SocketException) { |
There was a problem hiding this comment.
Based on the openjdk source code SocketException may be thrown too:
https://github.com/keerath/openjdk-8-source/blob/5f6e9d42a9f6b6736100c9c6f43f5f5ea1570cfb/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java#L1488
jojochuang
left a comment
There was a problem hiding this comment.
Adding more comments for future reference.
…d to ConnectException (apache#4329) Change-Id: I1608dec7f5003cf89af5e5f7f7962a20a069c050
Description of PR
Based on production workload, we found that it is not enough to map just SSLHandshakeException to ConnectException in Loadbalancing KMS Client but that needs to be extended to SSLExceptions and SocketExceptions.
How was this patch tested?
Updated existing unit tests.
For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?