You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Ritesh H Shukla (Jira)" <ji...@apache.org> on 2022/05/18 21:44:00 UTC

[jira] [Updated] (HADOOP-18245) Extend KMS related exceptions that get mapped to ConnectException

     [ https://issues.apache.org/jira/browse/HADOOP-18245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ritesh H Shukla updated HADOOP-18245:
-------------------------------------
    Description: 
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.

Sample JDK code that can raise these exceptions.

 {{
     /**
     * Read the initial handshake records.
     */
    private int readHandshakeRecord() throws IOException {
        while (!conContext.isInboundClosed()) {
            try {
                Plaintext plainText = decode(null);
                if ((plainText.contentType == ContentType.HANDSHAKE.id) &&
                        conContext.isNegotiated) {
                    return 0;
                }
            } catch (SSLException |
                    InterruptedIOException | SocketException se) {
                // Don't change exception in case of timeouts or interrupts
                // or SocketException.
                throw se;
            } catch (IOException ioe) {
                throw new SSLException("readHandshakeRecord", ioe);
            }
        }

        return -1;
    }}}

  was:
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. 

Sample JDK code that can raise these exceptions.
|/**|
|| * Read the initial handshake records.|
|| */|
||private int readHandshakeRecord() throws IOException {|
||while (!conContext.isInboundClosed()) {|
||try {|
||Plaintext plainText = decode(null);|
||if ((plainText.contentType == ContentType.HANDSHAKE.id) &&|
||conContext.isNegotiated) {|
||return 0;|
||}|
||} catch (SSLException \||
||InterruptedIOException \| SocketException se) {|
||// Don't change exception in case of timeouts or interrupts|
||// or SocketException.|
||throw se;|
||} catch (IOException ioe) {|
||throw new SSLException("readHandshakeRecord", ioe);|
||}|
||}|
|||
||return -1;|
||}|


> Extend KMS related exceptions that get mapped to ConnectException 
> ------------------------------------------------------------------
>
>                 Key: HADOOP-18245
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18245
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: kms
>            Reporter: Ritesh H Shukla
>            Priority: Major
>
> 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.
> Sample JDK code that can raise these exceptions.
>  {{
>      /**
>      * Read the initial handshake records.
>      */
>     private int readHandshakeRecord() throws IOException {
>         while (!conContext.isInboundClosed()) {
>             try {
>                 Plaintext plainText = decode(null);
>                 if ((plainText.contentType == ContentType.HANDSHAKE.id) &&
>                         conContext.isNegotiated) {
>                     return 0;
>                 }
>             } catch (SSLException |
>                     InterruptedIOException | SocketException se) {
>                 // Don't change exception in case of timeouts or interrupts
>                 // or SocketException.
>                 throw se;
>             } catch (IOException ioe) {
>                 throw new SSLException("readHandshakeRecord", ioe);
>             }
>         }
>         return -1;
>     }}}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org