Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api,netty: fix MethodDescriptor and InternalKnownTransport for netty-shaded (backport v1.28.x) #6776

Merged
merged 1 commit into from Feb 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions api/src/main/java/io/grpc/InternalKnownTransport.java
Expand Up @@ -24,6 +24,7 @@
@Internal
public enum InternalKnownTransport {
NETTY,
NETTY_SHADED,
;
}

3 changes: 1 addition & 2 deletions api/src/main/java/io/grpc/MethodDescriptor.java
Expand Up @@ -51,8 +51,7 @@ public final class MethodDescriptor<ReqT, RespT> {

// Must be set to InternalKnownTransport.values().length
// Not referenced to break the dependency.
private final AtomicReferenceArray<Object> rawMethodNames = new AtomicReferenceArray<>(1);

private final AtomicReferenceArray<Object> rawMethodNames = new AtomicReferenceArray<>(2);

/**
* Gets the cached "raw" method name for this Method Descriptor. The raw name is transport
Expand Down
4 changes: 3 additions & 1 deletion netty/src/main/java/io/grpc/netty/NettyClientStream.java
Expand Up @@ -54,7 +54,9 @@
*/
class NettyClientStream extends AbstractClientStream {
private static final InternalMethodDescriptor methodDescriptorAccessor =
new InternalMethodDescriptor(InternalKnownTransport.NETTY);
new InternalMethodDescriptor(
NettyClientTransport.class.getName().contains("grpc.netty.shaded")
? InternalKnownTransport.NETTY_SHADED : InternalKnownTransport.NETTY);

private final Sink sink = new Sink();
private final TransportState state;
Expand Down