This is an automated email from the ASF dual-hosted git repository. He-Pin pushed a commit to branch fix/tls-observability-3162 in repository https://gitbox.apache.org/repos/asf/pekko.git
commit b4f21bbae0e1aa26b8cae1029797d30e36e8705d Author: 虎鸣 <[email protected]> AuthorDate: Wed Jun 24 04:20:06 2026 +0800 fix: simplify redundant null check in TLS handshake failure handler Address review feedback: Netty guarantees cause() is non-null when isSuccess=false, so simplify the null check logic. --- .../org/apache/pekko/remote/transport/netty/NettySSLSupport.scala | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettySSLSupport.scala b/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettySSLSupport.scala index fb71b826d8..51bd2f8448 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettySSLSupport.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettySSLSupport.scala @@ -68,11 +68,10 @@ private[pekko] object NettySSLSupport { val handler = new SslHandler(sslEngine) handler.handshakeFuture().addListener((future: Future[Channel]) => { if (!future.isSuccess) { - val cause = if (future.cause() != null) future.cause() else null log.warning( - "TLS handshake failed for remote address [{}]. {}", + "TLS handshake failed for remote address [{}]: {}", sslEngine.getPeerHost, - if (cause != null) cause.getMessage else "unknown cause") + if (future.cause() != null) future.cause().getMessage else "unknown cause") handler.closeOutbound().channel().close() } }) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
