You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by GitBox <gi...@apache.org> on 2020/04/20 12:19:46 UTC

[GitHub] [kafka] rajinisivaram commented on a change in pull request #8506: Minor: avoid duplicate unwrapping when end of stream has been reached

rajinisivaram commented on a change in pull request #8506:
URL: https://github.com/apache/kafka/pull/8506#discussion_r411331273



##########
File path: clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java
##########
@@ -293,6 +293,11 @@ public void handshake() throws IOException {
                 updateBytesBuffered(true);
         } catch (SSLException e) {
             maybeProcessHandshakeFailure(e, true, null);
+        } catch (EOFException e) {
+            // it is impossible to complete handshake successfully due to end-of-stream. Hence, it should throw either
+            // EOFException or SslAuthenticationException directly.
+            maybeThrowSslAuthenticationException();
+            throw e;

Review comment:
       @chia7712 Is there a reason why we need this change? If so, can we add a test? If there is no data to unwrap, we would just throw the exception in the IOException catch block below anyway. Since we only get here when the other side has closed its connection, which is typically a handshake failure, I am not sure we need to optimize.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org