Skip to content

Commit 283f103

Browse files
authored
netty: Run handshakeCompleteRunnable in success cases
b/458734698
1 parent eb8a63c commit 283f103

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -702,9 +702,6 @@ protected void userEventTriggered0(ChannelHandlerContext ctx, Object evt) throws
702702
Exception ex =
703703
unavailableException("Failed ALPN negotiation: Unable to find compatible protocol");
704704
logSslEngineDetails(Level.FINE, ctx, "TLS negotiation failed.", ex);
705-
if (handshakeCompleteRunnable.isPresent()) {
706-
handshakeCompleteRunnable.get().run();
707-
}
708705
ctx.fireExceptionCaught(ex);
709706
}
710707
} else {
@@ -719,11 +716,11 @@ protected void userEventTriggered0(ChannelHandlerContext ctx, Object evt) throws
719716
.withCause(t)
720717
.asRuntimeException();
721718
}
722-
if (handshakeCompleteRunnable.isPresent()) {
723-
handshakeCompleteRunnable.get().run();
724-
}
725719
ctx.fireExceptionCaught(t);
726720
}
721+
if (handshakeCompleteRunnable.isPresent()) {
722+
handshakeCompleteRunnable.get().run();
723+
}
727724
} else {
728725
super.userEventTriggered0(ctx, evt);
729726
}

0 commit comments

Comments
 (0)