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

Multiple test failures using AdoptOpenJDK 8u252 (hs) #946

Closed
ignasi35 opened this issue May 1, 2020 · 8 comments · Fixed by #963
Closed

Multiple test failures using AdoptOpenJDK 8u252 (hs) #946

ignasi35 opened this issue May 1, 2020 · 8 comments · Fixed by #963

Comments

@ignasi35
Copy link
Member

ignasi35 commented May 1, 2020

Versions used

master on commit 52f006d6269ff7867d1abe39e92acb2d6c8486bb

Using SDKman I installed and setup the 8u252 JDK (sdk use java 8.0.252.hs-adpt).

Note that I can't reproduce any of the failures when rolling back to 8u242.

Expected Behavior

All tests pass when running sbt test

Actual Behavior

There are multiple test failures (consistently):

[error] Failed tests:
[error] 	akka.grpc.interop.GrpcInteropAkkaJavaWithAkkaScalaSpec
[error] 	akka.grpc.interop.GrpcInteropIoWithAkkaJavaSpec
[error] 	akka.grpc.interop.GrpcInteropAkkaJavaWithAkkaJavaSpec
[error] 	akka.grpc.interop.GrpcInteropAkkaScalaWithAkkaScalaSpec
[error] 	akka.grpc.interop.GrpcInteropAkkaScalaWithAkkaJavaSpec
[error] 	akka.grpc.interop.GrpcInteropIoWithAkkaScalaSpec
@ignasi35
Copy link
Member Author

ignasi35 commented May 1, 2020

Following is a test result matrix with more information.

GrpcInteropIoWithAkkaJavaSpec is represented as Server: Io / Client: Java so the information in the description of the issue is translated into the master column of the matrix. master actually represents the commit with SHA-1 52f006d.

The variants master + agent <version> represent changing only the JettyAgent version in the project extensions.

The variant master+"no agent" requires adding the setting Test / fork := true so interop tests run forked. The reason is that the JavaAgent plugin will fork tests under the covers but only if there's an agent in the classpath.

Server Client master master + agent 2.0.10 master + no agent akka-http#3125 + no agent
IO IO
IO java 🔴 🔴 🔴 🔴
IO Scala 🔴 🔴 🔴 🔴
java IO 🔴
java java 🔴 🔴 🔴 🔴
java Scala 🔴 🔴 🔴 🔴
Scala IO 🔴
Scala java 🔴 (1) 🔴 (2) 🔴 (3) 🔴 (3)
Scala Scala 🔴 🔴 🔴 🔴

Note that the matrix above still doesn't indicate the actual cause of failure of each particular test (which varies). Examples of failures:

1. `io.grpc.StatusRuntimeException: UNKNOWN: Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]` `Caused by: java.lang.NoSuchFieldError: nullSession`

That makes sense since the agent can't instrument the target bytecode.

Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: UNKNOWN: Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
        at io.grpc.testing.integration2.TestServiceClient.run(TestServiceClient.java:97)
        at akka.grpc.interop.AkkaGrpcClientJava.run(AkkaGrpcClientJava.java:39)
        at akka.grpc.interop.GrpcInteropTests.runGrpcClient(GrpcInteropTests.scala:87)
        at akka.grpc.interop.GrpcInteropTests.$anonfun$new$5(GrpcInteropTests.scala:49)
        at akka.grpc.interop.GrpcInteropTests.withGrpcServer(GrpcInteropTests.scala:59)
        ... 46 more
Caused by: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: UNKNOWN: Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1908)
        at scala.concurrent.java8.FuturesConvertersImpl$CF.super$get(FutureConvertersImpl.scala:82)
        at scala.concurrent.java8.FuturesConvertersImpl$CF.$anonfun$get$1(FutureConvertersImpl.scala:82)
        at scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:57)
        at scala.concurrent.package$.blocking(package.scala:146)
        at scala.concurrent.java8.FuturesConvertersImpl$CF.get(FutureConvertersImpl.scala:82)
        at akka.grpc.interop.AkkaGrpcJavaClientTester.pingPong(AkkaGrpcJavaClientTester.java:234)
        at io.grpc.testing.integration2.TestServiceClient.runTest(TestServiceClient.java:142)
        at io.grpc.testing.integration2.TestServiceClient.run(TestServiceClient.java:93)
        ... 50 more
Caused by: io.grpc.StatusRuntimeException: UNKNOWN: Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
        at io.grpc.Status.asRuntimeException(Status.java:533)
        at akka.grpc.internal.AkkaNettyGrpcClientGraphStage$$anon$1.onCallClosed(AkkaNettyGrpcClientGraphStage.scala:165)
        at akka.grpc.internal.AkkaNettyGrpcClientGraphStage$$anon$1.$anonfun$callback$1(AkkaNettyGrpcClientGraphStage.scala:71)
        at akka.grpc.internal.AkkaNettyGrpcClientGraphStage$$anon$1.$anonfun$callback$1$adapted(AkkaNettyGrpcClientGraphStage.scala:67)
        at akka.stream.impl.fusing.GraphInterpreter.runAsyncInput(GraphInterpreter.scala:452)
        at akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:481)
        at akka.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:581)
        at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:749)
        at akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:764)
        at akka.actor.Actor.aroundReceive(Actor.scala:539)
        at akka.actor.Actor.aroundReceive$(Actor.scala:537)
        at akka.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:671)
        at akka.actor.ActorCell.receiveMessage(ActorCell.scala:614)
        at akka.actor.ActorCell.invoke(ActorCell.scala:583)
        at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:268)
        at akka.dispatch.Mailbox.run(Mailbox.scala:229)
        at akka.dispatch.Mailbox.exec(Mailbox.scala:241)
        at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
        at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
        at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
        at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.NoSuchFieldError: nullSession
        at sun.security.ssl.ClientHandshaker.getKickstartMessage(ClientHandshaker.java:1350)
        at sun.security.ssl.Handshaker.kickstart(Handshaker.java:1117)
        at sun.security.ssl.SSLEngineImpl.kickstartHandshake(SSLEngineImpl.java:736)
        at sun.security.ssl.SSLEngineImpl.beginHandshake(SSLEngineImpl.java:758)
        at io.grpc.netty.shaded.io.netty.handler.ssl.JdkSslEngine.beginHandshake(JdkSslEngine.java:158)
        at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.handshake(SslHandler.java:1977)
        at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.startHandshakeProcessing(SslHandler.java:1898)
        at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.handlerAdded(SslHandler.java:1887)
        at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:956)
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:609)
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:269)
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:237)
        at io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$ClientTlsHandler.handlerAdded0(ProtocolNegotiators.java:352)
        at io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$ProtocolNegotiationHandler.handlerAdded(ProtocolNegotiators.java:726)
        at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:956)
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:609)
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.replace(DefaultChannelPipeline.java:572)
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.replace(DefaultChannelPipeline.java:515)
        at io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$ProtocolNegotiationHandler.fireProtocolNegotiationEvent(ProtocolNegotiators.java:767)
        at io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$WaitUntilActiveHandler.channelActive(ProtocolNegotiators.java:676)
2. `io.grpc.StatusRuntimeException: UNKNOWN: Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]` `Caused by: java.lang.NoSuchFieldError: nullSession`

This one is confusing since the version 2.0.10 should not try to instrument the 8u252 JVM.

Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: UNKNOWN: Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
        at io.grpc.testing.integration2.TestServiceClient.run(TestServiceClient.java:97)
        at akka.grpc.interop.AkkaGrpcClientJava.run(AkkaGrpcClientJava.java:39)
        at akka.grpc.interop.GrpcInteropTests.runGrpcClient(GrpcInteropTests.scala:87)
        at akka.grpc.interop.GrpcInteropTests.$anonfun$new$5(GrpcInteropTests.scala:49)
        at akka.grpc.interop.GrpcInteropTests.withGrpcServer(GrpcInteropTests.scala:59)
        ... 46 more
Caused by: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: UNKNOWN: Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1908)
        at scala.concurrent.java8.FuturesConvertersImpl$CF.super$get(FutureConvertersImpl.scala:82)
        at scala.concurrent.java8.FuturesConvertersImpl$CF.$anonfun$get$1(FutureConvertersImpl.scala:82)
        at scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:57)
        at scala.concurrent.package$.blocking(package.scala:146)
        at scala.concurrent.java8.FuturesConvertersImpl$CF.get(FutureConvertersImpl.scala:82)
        at akka.grpc.interop.AkkaGrpcJavaClientTester.largeUnary(AkkaGrpcJavaClientTester.java:104)
        at io.grpc.testing.integration2.TestServiceClient.runTest(TestServiceClient.java:114)
        at io.grpc.testing.integration2.TestServiceClient.run(TestServiceClient.java:93)
        ... 50 more
Caused by: io.grpc.StatusRuntimeException: UNKNOWN: Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
        at io.grpc.Status.asRuntimeException(Status.java:533)
        at akka.grpc.internal.UnaryCallAdapter.onClose(UnaryCallAdapter.scala:40)
        at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
        at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
        at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
        at io.grpc.census.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:701)
        at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
        at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
        at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
        at io.grpc.census.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:399)
        at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
        at io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:689)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$900(ClientCallImpl.java:577)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:751)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:740)
        at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
        at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
        ... 3 more
Caused by: java.lang.NoSuchFieldError: nullSession
        at sun.security.ssl.ClientHandshaker.getKickstartMessage(ClientHandshaker.java:1350)
        at sun.security.ssl.Handshaker.kickstart(Handshaker.java:1117)
        at sun.security.ssl.SSLEngineImpl.kickstartHandshake(SSLEngineImpl.java:736)
        at sun.security.ssl.SSLEngineImpl.beginHandshake(SSLEngineImpl.java:758)
        at io.grpc.netty.shaded.io.netty.handler.ssl.JdkSslEngine.beginHandshake(JdkSslEngine.java:158)
        at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.handshake(SslHandler.java:1977)
        at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.startHandshakeProcessing(SslHandler.java:1898)
        at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.handlerAdded(SslHandler.java:1887)
        at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:956)
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:609)
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:269)
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:237)
        at io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$ClientTlsHandler.handlerAdded0(ProtocolNegotiators.java:352)
        at io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$ProtocolNegotiationHandler.handlerAdded(ProtocolNegotiators.java:726)
        at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:956)
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:609)
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.replace(DefaultChannelPipeline.java:572)
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.replace(DefaultChannelPipeline.java:515)
        at io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$ProtocolNegotiationHandler.fireProtocolNegotiationEvent(ProtocolNegotiators.java:767)
        at io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$WaitUntilActiveHandler.channelActive(ProtocolNegotiators.java:676)
        at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:228)
        at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:214)
        at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelActive(AbstractChannelHandlerContext.java:207)
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.channelActive(DefaultChannelPipeline.java:1398)
        at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:228)
        at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:214)
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.fireChannelActive(DefaultChannelPipeline.java:895)
        at io.grpc.netty.shaded.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:305)
        at io.grpc.netty.shaded.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:335)
        at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:702)
        at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
        at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
        at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
        at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
        at io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        ... 1 more

UPDATE: apparently both 1. and 2. are caused by jetty-project/jetty-alpn#31

3. `UNAVAILABLE: Failed ALPN negotiation: Unable to find compatible protocol Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]`

This should have worked. I think the error in this one is on our code, though...

Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE: Failed ALPN negotiation: Unable to find compatible protocol
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
        at io.grpc.Status.asRuntimeException(Status.java:533)
        at akka.grpc.internal.UnaryCallAdapter.onClose(UnaryCallAdapter.scala:40)
        at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
        at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
        at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
        at io.grpc.census.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:701)
        at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
        at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
        at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
        at io.grpc.census.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:399)
        at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
        at io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:689)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$900(ClientCallImpl.java:577)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:751)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:740)
        at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
        at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
        ... 3 more

@ignasi35
Copy link
Member Author

ignasi35 commented May 1, 2020

Something I realized on my tests is that when running 8u252 the handshake message doesn't include the application_layer_protocol_negotiation extension field in the message:

  1. using jdk8u242 with the jetty ALPN agent 2.0.9 the alpn extension is added on the handshake message:

using_8u242_jetty_ALPN_agent_209

  1. using jdk8u252 the alpn extension is missing:

using_8u252

Note that the fields listed on each screenshot differ because the first screenshot is a debug session over the Jetty ALPN SSLEngine while the second screenshot is for the vanilla SSLEngine that ships on AdopOpenJDK 8u252.


Another (related?) difference is that when using 8u252 the code in akka-http that chooses the protocol is never invoked.

@ignasi35
Copy link
Member Author

ignasi35 commented May 1, 2020

I've narrowed down the problem to how akka-grpc creates Netty's SslContext from JDK's SSLContext in here.

I'm not entirely sure what is the correct sorcery we need to invoke but we're not setting up a JdkApplicationProtocolNegotiator. I tried creating my own but it required copy/pasting too much code from Netty and decided to stop. We may need to retake that option because I begin to suspect we're blocked until grpc-java bumps Netty to 4.1.49 which includes netty#10196 (fixing several version-dependant if's).

@ignasi35
Copy link
Member Author

ignasi35 commented May 4, 2020

Note to self: (thanks @raboof) extend the matrix above combining #933 and akka-http#3125

@ignasi35
Copy link
Member Author

ignasi35 commented May 4, 2020

See grpc/grpc-java#6997

@ignasi35
Copy link
Member Author

ignasi35 commented May 4, 2020

The reason why all the tests that use the vanilla grpc-java client succeed in the comment above is that grpc-java uses vanilla Netty tools to build the SslContext (that is Netty's SslContext, not to be confused with JDK's SSLContext).

In my machine, the vanilla Netty tools decide they can use the SslProvider.OPENSSL provider Netty includes and use that because some environemnt condition are fulfilled (openSSL is installed and a native library is available for my OS).

akka-grpc, OTOH, is hardcoded to use the SslProvider.JDK.

raboof added a commit to raboof/akka-grpc that referenced this issue May 11, 2020
To make the build succeed until we fix akka#946
raboof added a commit to raboof/akka-grpc that referenced this issue May 11, 2020
To make the build succeed until we fix akka#946
raboof added a commit that referenced this issue May 11, 2020
To make the build succeed until we fix #946
@raboof raboof reopened this May 11, 2020
@raboof
Copy link
Member

raboof commented May 11, 2020

@ignasi35 ignasi35 changed the title Multiple test failures using AdopOpenJDK 8u252 (hs) Multiple test failures using AdoptOpenJDK 8u252 (hs) May 11, 2020
@raboof
Copy link
Member

raboof commented May 14, 2020

Fixed by #964

@raboof raboof closed this as completed May 14, 2020
dwhjames added a commit to dwhjames/akka-grpc that referenced this issue Aug 3, 2022
Inserting a JDK `javax.net.ssl.SSLContext` into Netty originated in commit
https://github.com/richdougherty/akka-grpc/blob/aa05239c6cddcb20dfa0770e8e8e7649e3bbaaef/runtime/src/main/scala/akka/grpc/internal/NettyClientUtils.scala#L59-L82
in PR akka#266

It was removed in PR akka#964
to address Issue akka#946

It was returned in PR akka#979
to address Issue akka#978

---

Original comment was
```scala
    // FIXME: Create a JdkSslContext using a normal constructor. Need to work out sensible values for all args first.
    // In the meantime, use a Netty SslContextBuild to create a JdkSslContext, then use reflection to patch the
    // object's internal SSLContext. It's not pretty, but it gets something working for now.
```

---

This commit addresses the original `FIXME` comment, and avoids using
deprecated constructors on `io.grpc.netty.shaded.io.netty.handler.ssl.JdkSslContext`
raboof pushed a commit that referenced this issue Aug 22, 2022
Inserting a JDK `javax.net.ssl.SSLContext` into Netty originated in commit
https://github.com/richdougherty/akka-grpc/blob/aa05239c6cddcb20dfa0770e8e8e7649e3bbaaef/runtime/src/main/scala/akka/grpc/internal/NettyClientUtils.scala#L59-L82
in PR #266

It was removed in PR #964
to address Issue #946

It was returned in PR #979
to address Issue #978

---

Original comment was
```scala
    // FIXME: Create a JdkSslContext using a normal constructor. Need to work out sensible values for all args first.
    // In the meantime, use a Netty SslContextBuild to create a JdkSslContext, then use reflection to patch the
    // object's internal SSLContext. It's not pretty, but it gets something working for now.
```

---

This commit addresses the original `FIXME` comment, and avoids using
deprecated constructors on `io.grpc.netty.shaded.io.netty.handler.ssl.JdkSslContext`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants