From 73bade418b964458c18d6dbaaef9ef20b3addf4b Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Thu, 4 Apr 2019 12:35:22 -0700 Subject: [PATCH] netty: ALPN negotiation failure should be UNAVAILABLE, not UNKNOWN --- .../main/java/io/grpc/netty/ProtocolNegotiators.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java b/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java index 0f890728d4..304b7507b0 100644 --- a/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java +++ b/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java @@ -176,8 +176,9 @@ final class ProtocolNegotiators { // Replace this handler with the GRPC handler. ctx.pipeline().replace(this, null, grpcHandler); } else { - fail(ctx, new Exception( - "Failed protocol negotiation: Unable to find compatible protocol.")); + fail(ctx, + unavailableException( + "Failed protocol negotiation: Unable to find compatible protocol")); } } else { fail(ctx, handshakeEvent.cause()); @@ -333,8 +334,8 @@ final class ProtocolNegotiators { ctx.pipeline().replace(ctx.name(), null, next); fireProtocolNegotiationEvent(ctx, handler.engine().getSession()); } else { - Exception ex = new Exception( - "Failed ALPN negotiation: Unable to find compatible protocol."); + Exception ex = + unavailableException("Failed ALPN negotiation: Unable to find compatible protocol"); logSslEngineDetails(Level.FINE, ctx, "TLS negotiation failed.", ex); ctx.fireExceptionCaught(ex); } @@ -859,4 +860,4 @@ final class ProtocolNegotiators { ctx.fireUserEventTriggered(pne.withAttributes(attrs)); } } -} \ No newline at end of file +}