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

MethodDescriptor.setRawMethodName breaks Immutability if multiple types of transport are used #6765

Closed
dapengzhang0 opened this issue Feb 27, 2020 · 1 comment
Labels

Comments

@dapengzhang0
Copy link
Member

java.lang.ClassCastException: io.netty.util.AsciiString cannot be cast to io.grpc.netty.shaded.io.netty.util.AsciiString
	at io.grpc.netty.shaded.io.grpc.netty.NettyClientStream$Sink.writeHeadersInternal(NettyClientStream.java:130)
	at io.grpc.netty.shaded.io.grpc.netty.NettyClientStream$Sink.writeHeaders(NettyClientStream.java:122)
	at io.grpc.internal.AbstractClientStream.start(AbstractClientStream.java:166)
	at io.grpc.internal.ForwardingClientStream.start(ForwardingClientStream.java:87)
	at io.grpc.internal.InternalSubchannel$CallTracingTransport$1.start(InternalSubchannel.java:645)
	at io.grpc.internal.DelayedStream$5.run(DelayedStream.java:229)
	at io.grpc.internal.DelayedStream.drainPendingCalls(DelayedStream.java:163)
	at io.grpc.internal.DelayedStream.setStream(DelayedStream.java:132)
	at io.grpc.internal.DelayedClientTransport$PendingStream.createRealStream(DelayedClientTransport.java:358)
	at io.grpc.internal.DelayedClientTransport$PendingStream.access$300(DelayedClientTransport.java:341)
	at io.grpc.internal.DelayedClientTransport$5.run(DelayedClientTransport.java:300)
	at io.grpc.stub.ClientCalls$ThreadlessExecutor.waitAndDrain(ClientCalls.java:691)
	at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:133)
	at io.grpc.testing.integration.TestServiceGrpc$TestServiceBlockingStub.unaryCall(TestServiceGrpc.java:637)
	at io.grpc.testing.integration.CompressionTest.compression(CompressionTest.java:202)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.lang.Thread.run(Thread.java:748)
@ejona86
Copy link
Member

ejona86 commented Feb 27, 2020

We should probably have InternalMethodDescriptor (atomically) allocate an id when it is constructed. We would extend MethodDescriptor.rawMethodNames to be of size 3 or 4. If the id is above 3/4, then get() would always return null and set() would do nothing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants