Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.6.0, 2.8.0
-
None
-
None
Description
The Class "SaslChannelBuilder", the method "buildTransportLayer" is defined as follows (2.6.0):
protected TransportLayer buildTransportLayer(String id, SelectionKey key, SocketChannel socketChannel, ChannelMetadataRegistry metadataRegistry) throws IOException { if (this.securityProtocol == SecurityProtocol.SASL_SSL) { return SslTransportLayer.create(id, key, sslFactory.createSslEngine(socketChannel.socket().getInetAddress().getHostName(), socketChannel.socket().getPort()), metadataRegistry); } else { return new PlaintextTransportLayer(key); } }
When calling "getInetAddress()", the address is always available, because the Oracle Implementation of the "SocketChannel" class sets quite early the "remoteAddress" internally, even when the "isConnected" would return "false".
Oracle seems to have created a bug, because following the specification of Java class "SocketChannel", the "remoteAddress" should be set internally only after the connection has been successfully built.
Kafka follows the Oracle Implementation, NOT the java specification. Should this not be considered as bug in kafka?