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

Is there advisable to use okhttp instead netty? #8002

Closed
badabapidas opened this issue Mar 22, 2021 · 11 comments
Closed

Is there advisable to use okhttp instead netty? #8002

badabapidas opened this issue Mar 22, 2021 · 11 comments
Labels

Comments

@badabapidas
Copy link

Hi,

I had recently raised one issue #7907 where it is mentioned the issue along with of usage of OpenJSSE and the same is raised in OpenJSSE community as openjsse/openjsse#22. I am not sure by when we can expect any fix for this, so we are trying one more alternative but need your advice on the same.

I can see okhttp library has by default openjsse support but it is advisable to use only for android clients. If I change netty channel to okhttp for our grpc communication which is not android though, will it have any impact in terms of performance or any other aspect? Will okhttp library will be able to handle high load transactions? So in one line is it advisable to use okhttp in place of netty for grpc communication?

Thanks, Bapi

@voidzcy
Copy link
Contributor

voidzcy commented Mar 22, 2021

It depends on your use case and workload (e.g., modem-connected applications vs datacenter network). We'd generally recommend using Netty, as overall it's a more powerful transport and things (mostly, threading) can be turned very efficiently for high-performance network operations. I don't have numbers on my hand, @ejona86 may have more experience for it. I'd suggest trying it to see if throughput is a thing for your case. Note, there are many factors can impact the throughput and they may have different defaults in Netty and Okhttp (e.g., flow control window size), you may want to be aware of that when doing performance tuning.

@ejona86
Copy link
Member

ejona86 commented Mar 22, 2021

I don't think grpc-okhttp has support for OpenJSSE. gRPC handles the security for grpc-okhttp, so upstream support in okhttp doesn't buy you anything.

@badabapidas
Copy link
Author

badabapidas commented Mar 23, 2021

Thank you @voidzcy @ejona86 for your reply.

@ejona86 What I saw okhttp works out of the box with -XX:+UseOpenJSSE where as netty dont. I created a grpc client/server program where with netty I faced the issue as mentioned in #7907

But once I changed NettyChannelBuilder with OkHttpChannelBuilder thing started working for me and thats why I was under the impression okhttp has support for openjsse.

Interms of okhttp library, I have configured my project with io.grpc:grpc-okhttp which internally uses mostly com.squareup.okhttp if I am not wrong and we are using java8. Below is the exact gradle dependencies I am using now.
compile 'io.grpc:grpc-netty:1.27.0'
compile 'io.grpc:grpc-protobuf:1.27.0'
compile 'io.grpc:grpc-stub:1.27.0'
compile 'io.grpc:grpc-okhttp:1.27.0'
compile 'io.grpc:grpc-testing:1.27.0'
runtime 'io.netty:netty-tcnative-boringssl-static:2.0.25.Final'
compile 'io.netty:netty-handler:4.1.47.Final'
compile 'io.netty:netty-handler-proxy:4.1.47.Final'

Do you see any issue with the configuration? or any clue why okhttp works with openjsse as u mentioned it dont have the support.

Please let me know if you need further details.

Thanks, Bapi

@ejona86
Copy link
Member

ejona86 commented Mar 25, 2021

Oh, because the problem is with netty-tcnative and OpenJSSE is replacing the normal classes, that's why OkHttp works. You can use Netty without netty-tcnative and that should work as well.

If you exclude netty-tcnative-boringssl-static from you dependencies then it should fix the problem and use the JDK for security. But you can also explicitly request the JDK using NettyChannelBuilder:

nettyChannelBuilder.sslContext(
    GrpcSslContexts.configure(SslContextBuilder.forClient(), SslProvider.JDK).build());

That requires a semi-recent OpenJDK 8 build or newer, as ALPN was only recently backported to Java 8 from Java 11.

@badabapidas
Copy link
Author

badabapidas commented Mar 25, 2021

Thanks @ejona86

I have excluded 'io.netty:netty-tcnative-boringssl-static:2.0.25.Final' as suggested and tried running the client with JDK security configured as given below.

NettyChannelBuilder.forAddress(host, port).sslContext(GrpcSslContexts.configure(SslContextBuilder.forClient(), SslProvider.JDK).build()).build();

Java Version in Use

openjdk version "1.8.0_261"
OpenJDK Runtime Environment (Zulu 8.47.0.16-SA-win64) (build 1.8.0_261-b09)
OpenJDK 64-Bit Server VM (Zulu 8.47.0.16-SA-win64) (build 25.261-b09, mixed mode)

I am getting below exception

Exception in thread "main" io.grpc.StatusRuntimeException: UNKNOWN: Channel Pipeline: [WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
	at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:240)
	at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:221)
	at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:140)
	at com.proto.greet.GreetServiceGrpc$GreetServiceBlockingStub.greet(GreetServiceGrpc.java:406)
	at dummy.GreetingSSLClient.doUnaryCall(GreetingSSLClient.java:73)
	at dummy.GreetingSSLClient.run(GreetingSSLClient.java:32)
	at dummy.GreetingSSLClient.main(GreetingSSLClient.java:25)
Caused by: io.netty.channel.ChannelPipelineException: io.grpc.netty.ProtocolNegotiators$ClientTlsHandler.handlerAdded() has thrown an exception; removed.
	at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:624)
	at io.netty.channel.DefaultChannelPipeline.replace(DefaultChannelPipeline.java:572)
	at io.netty.channel.DefaultChannelPipeline.replace(DefaultChannelPipeline.java:515)
	at io.grpc.netty.ProtocolNegotiators$ProtocolNegotiationHandler.fireProtocolNegotiationEvent(ProtocolNegotiators.java:765)
	at io.grpc.netty.ProtocolNegotiators$WaitUntilActiveHandler.channelActive(ProtocolNegotiators.java:674)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:230)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:216)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelActive(AbstractChannelHandlerContext.java:209)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelActive(DefaultChannelPipeline.java:1398)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:230)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:216)
	at io.netty.channel.DefaultChannelPipeline.fireChannelActive(DefaultChannelPipeline.java:895)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:305)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:335)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:702)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/ALPN$Provider
	at io.netty.handler.ssl.JettyAlpnSslEngine.newClientEngine(JettyAlpnSslEngine.java:55)
	at io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator$AlpnWrapper.wrapSslEngine(JdkAlpnApplicationProtocolNegotiator.java:142)
	at io.netty.handler.ssl.JdkSslContext.configureAndWrapEngine(JdkSslContext.java:360)
	at io.netty.handler.ssl.JdkSslContext.newEngine(JdkSslContext.java:335)
	at io.grpc.netty.ProtocolNegotiators$ClientTlsHandler.handlerAdded0(ProtocolNegotiators.java:347)
	at io.grpc.netty.ProtocolNegotiators$ProtocolNegotiationHandler.handlerAdded(ProtocolNegotiators.java:724)
	at io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:971)
	at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:609)
	... 21 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.alpn.ALPN$Provider
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	... 29 more

Could you please let me know if this java has alpn support, if not which version should I use. Do I have to add more libraries in my gradle scripts for alpn support?

If needed I can create a sample github project and share, so that it will be useful for you as well to go through. Please let me know if that helps.

Thanks Bapi

@ejona86
Copy link
Member

ejona86 commented Mar 25, 2021

It seems Netty is too old. Netty 4.1.49.Final added support ALPN via the backported Java 9 API ("Ensure we support ALPN when using java 8u251"). That means I'd suggest you using grpc version 1.32+ and the corresponding Netty version. Although I'm surprised you are getting as far as you are. I'd expect things to be more broken without direct OpenJSSE support (#7907).

Normally that error message would be much more clear. The logic gRPC uses to pre-detect ALPN and produce a better error message is apparently finding the Java 9 ALPN API is available so it didn't give an error (I think; but for some reason I see the "pretty error"; see below). But Netty did its own checks and "Java 8 doesn't support ALPN" was a (reasonable-for-the-time) assumption in the Netty code, which then assumed it was expected to use Jetty ALPN boot which didn't work.


If we need another iteration, then yeah, a reproduction may be in order. I tried to reproduce what you saw using the azul/zulu-openjdk:8 docker image and grpc-java 1.27.0, but tcnative was working even with -XX:+UseOpenJSSE.

openjdk version "1.8.0_282"
OpenJDK Runtime Environment (Zulu 8.52.0.23-CA-linux64) (build 1.8.0_282-b08)
OpenJDK 64-Bit Server VM (Zulu 8.52.0.23-CA-linux64) (build 25.282-b08, mixed mode)

Excluding tcnative did let me reproduce openjsse/openjsse#22 but with Conscrypt:

Caused by: java.lang.ClassCastException: org.conscrypt.ConscryptEngine cannot be cast to org.openjsse.javax.net.ssl.SSLEngine
	at org.openjsse.sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:273)
	at org.openjsse.sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:147)
	at org.conscrypt.Platform.checkServerTrusted(Platform.java:329)
	at org.conscrypt.ConscryptEngine.verifyCertificateChain(ConscryptEngine.java:1637)
	... 30 more

Excluding Conscrypt gave the error I expected you to have gotten:

Mar 25, 2021 4:24:36 PM io.grpc.netty.GrpcSslContexts defaultSslProvider
INFO: Java 9 ALPN API unavailable (this may be normal)
Mar 25, 2021 4:24:36 PM io.grpc.netty.GrpcSslContexts defaultSslProvider
INFO: netty-tcnative unavailable (this may be normal)
java.lang.ClassNotFoundException: io.netty.internal.tcnative.SSL
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:121)
	at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:217)
	at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:144)
	at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:93)
	at io.grpc.testing.integration.TestServiceClient$Tester.createChannel(TestServiceClient.java:409)
	at io.grpc.testing.integration.AbstractInteropTest.setUp(AbstractInteropTest.java:309)
	at io.grpc.testing.integration.TestServiceClient.setUp(TestServiceClient.java:198)
	at io.grpc.testing.integration.TestServiceClient.main(TestServiceClient.java:56)

Mar 25, 2021 4:24:36 PM io.grpc.netty.GrpcSslContexts defaultSslProvider
INFO: Conscrypt not found (this may be normal)
java.lang.ClassNotFoundException: org.conscrypt.Conscrypt
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at io.grpc.internal.ConscryptLoader.newProvider(ConscryptLoader.java:72)
	at io.grpc.netty.GrpcSslContexts$ConscryptHolder.<clinit>(GrpcSslContexts.java:277)
	at io.grpc.netty.GrpcSslContexts.findJdkProvider(GrpcSslContexts.java:250)
	at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:221)
	at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:144)
	at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:93)
	at io.grpc.testing.integration.TestServiceClient$Tester.createChannel(TestServiceClient.java:409)
	at io.grpc.testing.integration.AbstractInteropTest.setUp(AbstractInteropTest.java:309)
	at io.grpc.testing.integration.TestServiceClient.setUp(TestServiceClient.java:198)
	at io.grpc.testing.integration.TestServiceClient.main(TestServiceClient.java:56)

Mar 25, 2021 4:24:36 PM io.grpc.netty.GrpcSslContexts defaultSslProvider
INFO: Jetty ALPN unavailable (this may be normal)
java.lang.ClassNotFoundException: org/eclipse/jetty/alpn/ALPN
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at io.grpc.netty.JettyTlsUtil.isJettyAlpnConfigured(JettyTlsUtil.java:64)
	at io.grpc.netty.JettyTlsUtil.getJettyAlpnUnavailabilityCause(JettyTlsUtil.java:76)
	at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:232)
	at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:144)
	at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:93)
	at io.grpc.testing.integration.TestServiceClient$Tester.createChannel(TestServiceClient.java:409)
	at io.grpc.testing.integration.AbstractInteropTest.setUp(AbstractInteropTest.java:309)
	at io.grpc.testing.integration.TestServiceClient.setUp(TestServiceClient.java:198)
	at io.grpc.testing.integration.TestServiceClient.main(TestServiceClient.java:56)

Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalStateException: Could not find TLS ALPN provider; no working netty-tcnative, Conscrypt, or Jetty NPN/ALPN available
	at io.grpc.testing.integration.TestServiceClient$Tester.createChannel(TestServiceClient.java:412)
	at io.grpc.testing.integration.AbstractInteropTest.setUp(AbstractInteropTest.java:309)
	at io.grpc.testing.integration.TestServiceClient.setUp(TestServiceClient.java:198)
	at io.grpc.testing.integration.TestServiceClient.main(TestServiceClient.java:56)
Caused by: java.lang.IllegalStateException: Could not find TLS ALPN provider; no working netty-tcnative, Conscrypt, or Jetty NPN/ALPN available
	at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:233)
	at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:144)
	at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:93)
	at io.grpc.testing.integration.TestServiceClient$Tester.createChannel(TestServiceClient.java:409)
	... 3 more

And no upgrading of gRPC/Netty fixes that because gRPC doesn't know that OpenJSSE is an option. The Java 9 API is sort of annoying to tell if it is supported, so even if the API itself is there, gRPC limits itself to just SunJSSE.

@ejona86
Copy link
Member

ejona86 commented Mar 25, 2021

I took a look at the grpc-okhttp ALPN detection code and while it also has some important limitations, it looks like it very well could detect the Java 9 ALPN API in your situation. So I would generally expect you'd need to use grpc-okhttp until #7907 is resolved.

grpc-okhttp should mostly work fine, but it is client-only and each Channel will use 1-2 threads. For small to moderate scale it should work well enough.

@badabapidas
Copy link
Author

@ejona86 Thank you so much for your detailed explanations.

I have tried with the same zulu version what is working for you but for me its the same exception as mentioned here

JAVA in use

openjdk version "1.8.0_282"
OpenJDK Runtime Environment (Zulu 8.52.0.23-CA-win64) (build 1.8.0_282-b08)
OpenJDK 64-Bit Server VM (Zulu 8.52.0.23-CA-win64) (build 25.282-b08, mixed mode)

Gradle file

**compile 'io.grpc:grpc-netty:1.27.0'
compile 'io.grpc:grpc-protobuf:1.27.0'
compile 'io.grpc:grpc-stub:1.27.0'
compile 'io.grpc:grpc-okhttp:1.27.0'
compile 'io.grpc:grpc-testing:1.27.0'
//compile 'io.netty:netty-tcnative:2.0.25.Final'

runtime 'io.netty:netty-tcnative-boringssl-static:2.0.25.Final'
    compile 'io.netty:netty-handler:4.1.49.Final'**

Its strange if the same worked for you only difference I can see the os, for me its windows and in your case its linux.

And if I excluding io.netty:netty-tcnative-boringssl-static throw below

Mar 26, 2021 12:42:23 PM io.grpc.netty.GrpcSslContexts defaultSslProvider
INFO: Java 9 ALPN API unavailable (this may be normal)
Mar 26, 2021 12:42:23 PM io.grpc.netty.GrpcSslContexts defaultSslProvider
INFO: netty-tcnative unavailable (this may be normal)
java.lang.ClassNotFoundException: io.netty.internal.tcnative.SSL
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at io.netty.handler.ssl.OpenSsl.(OpenSsl.java:121)
at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:217)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:144)
at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:93)
at dummy.GreetingSSLClient.loadServerSideTLSConfigs(GreetingSSLClient.java:42)
at dummy.ClientFactory2.getChannel(ClientFactory2.java:24)
at dummy.GreetingSSLClient.run(GreetingSSLClient.java:30)
at dummy.GreetingSSLClient.main(GreetingSSLClient.java:25)

Mar 26, 2021 12:42:23 PM io.grpc.netty.GrpcSslContexts defaultSslProvider
INFO: Conscrypt not found (this may be normal)
java.lang.ClassNotFoundException: org.conscrypt.Conscrypt
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at io.grpc.internal.ConscryptLoader.newProvider(ConscryptLoader.java:72)
at io.grpc.netty.GrpcSslContexts$ConscryptHolder.(GrpcSslContexts.java:277)
at io.grpc.netty.GrpcSslContexts.findJdkProvider(GrpcSslContexts.java:250)
at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:221)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:144)
at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:93)
at dummy.GreetingSSLClient.loadServerSideTLSConfigs(GreetingSSLClient.java:42)
at dummy.ClientFactory2.getChannel(ClientFactory2.java:24)
at dummy.GreetingSSLClient.run(GreetingSSLClient.java:30)
at dummy.GreetingSSLClient.main(GreetingSSLClient.java:25)

Mar 26, 2021 12:42:23 PM io.grpc.netty.GrpcSslContexts defaultSslProvider
INFO: Jetty ALPN unavailable (this may be normal)
java.lang.ClassNotFoundException: org/eclipse/jetty/alpn/ALPN
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at io.grpc.netty.JettyTlsUtil.isJettyAlpnConfigured(JettyTlsUtil.java:64)
at io.grpc.netty.JettyTlsUtil.getJettyAlpnUnavailabilityCause(JettyTlsUtil.java:76)
at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:232)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:144)
at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:93)
at dummy.GreetingSSLClient.loadServerSideTLSConfigs(GreetingSSLClient.java:42)
at dummy.ClientFactory2.getChannel(ClientFactory2.java:24)
at dummy.GreetingSSLClient.run(GreetingSSLClient.java:30)
at dummy.GreetingSSLClient.main(GreetingSSLClient.java:25)

Exception in thread "main" java.lang.IllegalStateException: Could not find TLS ALPN provider; no working netty-tcnative, Conscrypt, or Jetty NPN/ALPN available
at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:233)
at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:144)
at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:93)
at dummy.GreetingSSLClient.loadServerSideTLSConfigs(GreetingSSLClient.java:42)
at dummy.ClientFactory2.getChannel(ClientFactory2.java:24)
at dummy.GreetingSSLClient.run(GreetingSSLClient.java:30)
at dummy.GreetingSSLClient.main(GreetingSSLClient.java:25)

Couple of questions for your remark I would generally expect you'd need to use grpc-okhttp until #7907 is ### resolved

  • When can we expect Do GRPC netty works with OpenJSSE #7907 be available for usage?
  • When you told grpc-okhttp also has some important limitations what are those?
  • For small to moderate scale it should work well enough. I can have many clients sending millions of transaction will it be capable of handling those? As for each client channel will be separate but I wan to know the load of transaction it can handle max if there is any count handy.

Thanks, Bapi

@badabapidas
Copy link
Author

@ejona86 Your input will be highly appreciable here :-)

@ejona86
Copy link
Member

ejona86 commented Apr 2, 2021

I disabled tcnative and I saw cast exceptions, but for Conscrypt. I can live with assuming the problem is the different platform; I can think of a few ways it could change behavior.

I just sent out #8042 and I think it is pretty safe to include to the upcoming release next week (1.37). Let's see how all that goes.

When I said "limitation" earlier I was speaking of the TLS ALPN logic specifically. That code will either work or not, and it looks like it'll work for you.

grpc-okhttp should be able to handle lots of RPCs. There may be a few RPCs that fail if you do more than 2^31 RPCs on a connection, but that will be just a small blip of failures and it should recover fine. We know less about its performance characteristics if you are doing 100 MB messages or the like, simply because I'm not aware of anyone actually doing that in production with it. Looking at an older benchmark run I did (we care about "Before" because that PR ended up being reverted later), it does ½ the byte throughput as Netty but has the same latency for unary RPCs. It is multiple times faster than Netty for lots of small messages on a single stream (#6696), but that is a subtle conversation.

@ejona86
Copy link
Member

ejona86 commented Apr 13, 2021

I think this is all addressed now, as grpc-okhttp is fine to use outside of mobile but we want to be aware of deficiencies in grpc-netty so we can address them. With the release of v1.37.0 grpc-netty should be working now for Zulu when OpenJSSE is enabled.

If I missed something, comment and this can be reopened.

@ejona86 ejona86 closed this as completed Apr 13, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 13, 2021
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

3 participants