grpc-java icon indicating copy to clipboard operation
grpc-java copied to clipboard

GRPC tests fail and hang with JDK 1.8.0_73

Open matthild opened this issue 10 years ago • 7 comments

Making the following change in build.gradle gets everything working again:

-        def alpnboot_version = '8.1.2.v20141202'
+        def alpnboot_version = '8.1.7.v20160121'

However, doing so would probably break the build for developers using an old JDK and for Travis.

Should the current logic for choosing the ALPN version accommodate more than one version of Java 8, or is the current approach intentional?

matthild avatar Feb 29 '16 18:02 matthild

It should accommodate more than one version of Java 8.

ejona86 avatar Mar 01 '16 03:03 ejona86

This only affects building gRPC from source. Does not affect people using gRPC packages.

hsaliak avatar Apr 26 '16 17:04 hsaliak

May be of use https://github.com/jetty-project/jetty-alpn-agent

ejona86 avatar Apr 28 '16 23:04 ejona86

Some more info: https://www.eclipse.org/jetty/documentation/current/alpn-chapter.html#alpn-versions

ejona86 avatar Apr 28 '16 23:04 ejona86

http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.mortbay.jetty.alpn%22%20a%3Ajetty-alpn-agent

ejona86 avatar Apr 28 '16 23:04 ejona86

A quick attempt looks like it may work.

diff --git a/build.gradle b/build.gradle
index 2f7b20f..cc0ec46 100644
--- a/build.gradle
+++ b/build.gradle
@@ -164,6 +164,7 @@ subprojects {
     // Define a separate configuration for managing the dependency on Jetty alpnboot jar.
     configurations {
         alpnboot
+        alpnagent
         tcnative
     }

@@ -172,7 +173,8 @@ subprojects {
                     libraries.mockito

         // Configuration for modules that use Jetty ALPN
         alpnboot alpnboot_package_name
+        alpnagent 'org.mortbay.jetty.alpn:jetty-alpn-agent:2.0.2'

         // Configuration for modules that use Netty tcnative (for OpenSSL).
         tcnative libraries.netty_tcnative
diff --git a/netty/build.gradle b/netty/build.gradle
index 7f76b0c..4677048 100644
--- a/netty/build.gradle
+++ b/netty/build.gradle
@@ -9,7 +9,7 @@ dependencies {
 }

 test {
-    jvmArgs "-Xbootclasspath/p:" + configurations.alpnboot.asPath
+    jvmArgs "-javaagent:" + configurations.alpnagent.asPath
 }

 javadoc.options.links 'http://netty.io/4.1/api/'

ejona86 avatar Apr 28 '16 23:04 ejona86

resolve by the commit: use Jetty ALPN agent instead of Jetty ALPN #1760

dapengzhang0 avatar May 02 '16 22:05 dapengzhang0