The Java gRPC implementation. HTTP/2 based RPC

Related tags

grpc-java
Overview

gRPC-Java - An RPC library and framework

gRPC-Java works with JDK 7. gRPC-Java clients are supported on Android API levels 16 and up (Jelly Bean and later). Deploying gRPC servers on an Android device is not supported.

TLS usage typically requires using Java 8, or Play Services Dynamic Security Provider on Android. Please see the Security Readme.

Homepage: grpc.io
Mailing List: [email protected]

Join the chat at https://gitter.im/grpc/grpc Build Status Line Coverage Status Branch-adjusted Line Coverage Status

Getting Started

For a guided tour, take a look at the quick start guide or the more explanatory gRPC basics.

The examples and the Android example are standalone projects that showcase the usage of gRPC.

Download

Download the JARs. Or for Maven with non-Android, add to your pom.xml:

<dependency>
  <groupId>io.grpc</groupId>
  <artifactId>grpc-netty-shaded</artifactId>
  <version>1.36.0</version>
</dependency>
<dependency>
  <groupId>io.grpc</groupId>
  <artifactId>grpc-protobuf</artifactId>
  <version>1.36.0</version>
</dependency>
<dependency>
  <groupId>io.grpc</groupId>
  <artifactId>grpc-stub</artifactId>
  <version>1.36.0</version>
</dependency>
<dependency> <!-- necessary for Java 9+ -->
  <groupId>org.apache.tomcat</groupId>
  <artifactId>annotations-api</artifactId>
  <version>6.0.53</version>
  <scope>provided</scope>
</dependency>

Or for Gradle with non-Android, add to your dependencies:

implementation 'io.grpc:grpc-netty-shaded:1.36.0'
implementation 'io.grpc:grpc-protobuf:1.36.0'
implementation 'io.grpc:grpc-stub:1.36.0'
compileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+

For Android client, use grpc-okhttp instead of grpc-netty-shaded and grpc-protobuf-lite instead of grpc-protobuf:

implementation 'io.grpc:grpc-okhttp:1.36.0'
implementation 'io.grpc:grpc-protobuf-lite:1.36.0'
implementation 'io.grpc:grpc-stub:1.36.0'
compileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+

Development snapshots are available in Sonatypes's snapshot repository.

Generated Code

For protobuf-based codegen, you can put your proto files in the src/main/proto and src/test/proto directories along with an appropriate plugin.

For protobuf-based codegen integrated with the Maven build system, you can use protobuf-maven-plugin (Eclipse and NetBeans users should also look at os-maven-plugin's IDE documentation):

<build>
  <extensions>
    <extension>
      <groupId>kr.motd.maven</groupId>
      <artifactId>os-maven-plugin</artifactId>
      <version>1.6.2</version>
    </extension>
  </extensions>
  <plugins>
    <plugin>
      <groupId>org.xolstice.maven.plugins</groupId>
      <artifactId>protobuf-maven-plugin</artifactId>
      <version>0.6.1</version>
      <configuration>
        <protocArtifact>com.google.protobuf:protoc:3.12.0:exe:${os.detected.classifier}</protocArtifact>
        <pluginId>grpc-java</pluginId>
        <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.36.0:exe:${os.detected.classifier}</pluginArtifact>
      </configuration>
      <executions>
        <execution>
          <goals>
            <goal>compile</goal>
            <goal>compile-custom</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

For non-Android protobuf-based codegen integrated with the Gradle build system, you can use protobuf-gradle-plugin:

plugins {
    id 'com.google.protobuf' version '0.8.15'
}

protobuf {
  protoc {
    artifact = "com.google.protobuf:protoc:3.12.0"
  }
  plugins {
    grpc {
      artifact = 'io.grpc:protoc-gen-grpc-java:1.36.0'
    }
  }
  generateProtoTasks {
    all()*.plugins {
      grpc {}
    }
  }
}

The prebuilt protoc-gen-grpc-java binary uses glibc on Linux. If you are compiling on Alpine Linux, you may want to use the Alpine grpc-java package which uses musl instead.

For Android protobuf-based codegen integrated with the Gradle build system, also use protobuf-gradle-plugin but specify the 'lite' options:

plugins {
    id 'com.google.protobuf' version '0.8.15'
}

protobuf {
  protoc {
    artifact = "com.google.protobuf:protoc:3.12.0"
  }
  plugins {
    grpc {
      artifact = 'io.grpc:protoc-gen-grpc-java:1.36.0'
    }
  }
  generateProtoTasks {
    all().each { task ->
      task.builtins {
        java { option 'lite' }
      }
      task.plugins {
        grpc { option 'lite' }
      }
    }
  }
}

API Stability

APIs annotated with @Internal are for internal use by the gRPC library and should not be used by gRPC users. APIs annotated with @ExperimentalApi are subject to change in future releases, and library code that other projects may depend on should not use these APIs.

We recommend using the grpc-java-api-checker (an Error Prone plugin) to check for usages of @ExperimentalApi and @Internal in any library code that depends on gRPC. It may also be used to check for @Internal usage or unintended @ExperimentalApi consumption in non-library code.

How to Build

If you are making changes to gRPC-Java, see the compiling instructions.

High-level Components

At a high level there are three distinct layers to the library: Stub, Channel, and Transport.

Stub

The Stub layer is what is exposed to most developers and provides type-safe bindings to whatever datamodel/IDL/interface you are adapting. gRPC comes with a plugin to the protocol-buffers compiler that generates Stub interfaces out of .proto files, but bindings to other datamodel/IDL are easy and encouraged.

Channel

The Channel layer is an abstraction over Transport handling that is suitable for interception/decoration and exposes more behavior to the application than the Stub layer. It is intended to be easy for application frameworks to use this layer to address cross-cutting concerns such as logging, monitoring, auth, etc.

Transport

The Transport layer does the heavy lifting of putting and taking bytes off the wire. The interfaces to it are abstract just enough to allow plugging in of different implementations. Note the transport layer API is considered internal to gRPC and has weaker API guarantees than the core API under package io.grpc.

gRPC comes with three Transport implementations:

  1. The Netty-based transport is the main transport implementation based on Netty. It is for both the client and the server.
  2. The OkHttp-based transport is a lightweight transport based on OkHttp. It is mainly for use on Android and is for client only.
  3. The in-process transport is for when a server is in the same process as the client. It is useful for testing, while also being safe for production use.
Issues
  • Fix memeory leak in MessageFramer

    Fix memeory leak in MessageFramer

    Fixes

    https://github.com/grpc/grpc-java/issues/336

    opened by louiscryan 40
  • Channel interface needs shutdown/close

    Channel interface needs shutdown/close

    With the elimination of Service the Channel interface is now insufficient for normal use.

    While ChannelImpl has a shutdown Channel does not and intercepting a ChannelImpl immediately converts it into Channel.

    Closeable/AutoCloseable would be fine too

    api-breaking 
    opened by louiscryan 38
  • Shade Netty transport

    Shade Netty transport

    The entire transport is shaded because we wouldn't want to collide with the unshaded form of grpc-netty.

    Type: Feature 
    opened by ejona86 36
  • Flaky CompressionTest

    Flaky CompressionTest

    Found in https://travis-ci.org/grpc/grpc-java/jobs/151357545

    io.grpc.testing.integration.CompressionTest > compression[23] FAILED
        io.grpc.StatusRuntimeException: INTERNAL: Exception deframing message
            at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:230)
            at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:211)
            at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:144)
            at io.grpc.testing.integration.TestServiceGrpc$TestServiceBlockingStub.unaryCall(TestServiceGrpc.java:369)
            at io.grpc.testing.integration.CompressionTest.compression(CompressionTest.java:217)
            Caused by:
            io.grpc.StatusRuntimeException: INTERNAL: Can't decode compressed frame as compression not configured.
    
    code health highly flaky 
    opened by zhangkun83 35
  • Could not find TLS ALPN provider; no working netty-tcnative, Conscrypt, or Jetty NPN/ALPN available

    Could not find TLS ALPN provider; no working netty-tcnative, Conscrypt, or Jetty NPN/ALPN available

    Please answer these questions before submitting your issue.

    What version of gRPC are you using?

    1.13.1

    What did you expect to see?

    The jar should be running fine.

    I am using java 8 to build an executable jar. Below is the java version:

    $ /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/bin/java -version
    openjdk version "1.8.0_171"
    OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-2~14.04-b11)
    OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)
    

    I am using gradle 3.4.1 to generate the jar as follows: /opt/gradle-3.4.1/bin/gradle jar -Dorg.gradle.java.home=/usr/lib/jvm/java-1.8.0-openjdk-amd64/ Below are the dependencies defined in the module-level build.gradle file:

    dependencies {
      compile files("$TOOLCHAIN_VERSION_DIR/lib/commons-io-2.6.jar")
      compile files("$TOOLCHAIN_VERSION_DIR/lib/grpc-all.jar")
      compile files("$TOOLCHAIN_VERSION_DIR/lib/java-protobuf.jar")
      compile files("$TOOLCHAIN_VERSION_DIR/lib/jetty.jar")
      compile files("$TOOLCHAIN_VERSION_DIR/lib/log4j-core-2.8.jar")
      compile files("$TOOLCHAIN_VERSION_DIR/lib/log4j-slf4j-impl-2.8.jar")
      compile files("$TOOLCHAIN_VERSION_DIR/lib/netty-tcnative-boringssl-static-2.0.20.Final.jar")
      compile files("$TOOLCHAIN_VERSION_DIR/lib/netty-tcnative-2.0.20.Final.jar")
      compile files("$TOOLCHAIN_VERSION_DIR/lib/picocli-3.8.2.jar")
      compile group: 'com.google.guava', name: 'guava', version: '20.0'
      compile files("$TOOLCHAIN_VERSION_DIR/lib/javassist-3.19.0-GA.jar")
      compile project(':annotation')
    }
    

    After building, I am running the jar on an AIX7.2 machine as follows: /usr/java8_64/jre/bin/java -jar agent-1.0.jar

    The java version on the AIX machine is as follows:

    $ /usr/java8_64/jre/bin/java -version           
    java version "1.8.0_191"
    Java(TM) SE Runtime Environment (build 8.0.5.26 - pap6480sr5fp26-20181115_03(SR5 FP26))
    IBM J9 VM (build 2.9, JRE 1.8.0 AIX ppc64-64-Bit Compressed References 20181106_401576 (JIT enabled, AOT enabled)
    OpenJ9   - fde1d6f
    OMR      - d8c3617
    IBM      - 5c4a9f0)
    JCL - 20181022_01 based on Oracle jdk8u191-b26
    

    But I am getting the following error while running:

    Feb 17, 2019 3:11:33 AM io.grpc.netty.GrpcSslContexts defaultSslProvider
    INFO: netty-tcnative unavailable (this may be normal)
    java.lang.IllegalArgumentException: Failed to load any of the given libraries: [netty_tcnative_aix_ppc_64, netty_tcnative_ppc_64, netty_tcnative]
            at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:93)
            at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:430)
            at io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:97)
            at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:242)
            at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:171)
            at io.grpc.netty.GrpcSslContexts.forServer(GrpcSslContexts.java:151)
            at io.grpc.netty.NettyServerBuilder.useTransportSecurity(NettyServerBuilder.java:456)
            at io.grpc.netty.NettyServerBuilder.useTransportSecurity(NettyServerBuilder.java:55)
            at com.ankit.agents.AgentMain.<init>(AgentMain.java:91)
            at com.ankit.agents.AgentMain.main(AgentMain.java:132)
            Suppressed: java.lang.UnsatisfiedLinkError: could not load a native library: netty_tcnative_aix_ppc_64
                    at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:205)
                    at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:85)
                    ... 9 more
            Caused by: java.io.FileNotFoundException: META-INF/native/libnetty_tcnative_aix_ppc_64.a
                    at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:161)
                    ... 10 more
                    Suppressed: java.lang.UnsatisfiedLinkError: netty_tcnative_aix_ppc_64 (Not found in java.library.path)
                            at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1425)
                            at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1395)
                            at java.lang.System.loadLibrary(System.java:565)
                            at io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)
                            at io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:243)
                            at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:124)
                            ... 10 more
                            Suppressed: java.lang.UnsatisfiedLinkError: netty_tcnative_aix_ppc_64 (Not found in java.library.path)
                                    at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1425)
                                    at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1395)
                                    at java.lang.System.loadLibrary(System.java:565)
                                    at io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
                                    at java.lang.reflect.Method.invoke(Method.java:508)
                                    at io.netty.util.internal.NativeLibraryLoader$1.run(NativeLibraryLoader.java:263)
                                    at java.security.AccessController.doPrivileged(AccessController.java:647)
                                    at io.netty.util.internal.NativeLibraryLoader.loadLibraryByHelper(NativeLibraryLoader.java:255)
                                    at io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:233)
                                    ... 11 more
            Suppressed: java.lang.UnsatisfiedLinkError: could not load a native library: netty_tcnative_ppc_64
                    at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:205)
                    at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:85)
                    ... 9 more
            Caused by: java.io.FileNotFoundException: META-INF/native/libnetty_tcnative_ppc_64.a
                    at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:161)
                    ... 10 more
                    Suppressed: java.lang.UnsatisfiedLinkError: netty_tcnative_ppc_64 (Not found in java.library.path)
                            at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1425)
                            at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1395)
                            at java.lang.System.loadLibrary(System.java:565)
                            at io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)
                            at io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:243)
                            at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:124)
                            ... 10 more
                            Suppressed: java.lang.UnsatisfiedLinkError: netty_tcnative_ppc_64 (Not found in java.library.path)
                                    at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1425)
                                    at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1395)
                                    at java.lang.System.loadLibrary(System.java:565)
                                    at io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
                                    at java.lang.reflect.Method.invoke(Method.java:508)
                                    at io.netty.util.internal.NativeLibraryLoader$1.run(NativeLibraryLoader.java:263)
                                    at java.security.AccessController.doPrivileged(AccessController.java:647)
                                    at io.netty.util.internal.NativeLibraryLoader.loadLibraryByHelper(NativeLibraryLoader.java:255)
                                    at io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:233)
                                    ... 11 more
            Suppressed: java.lang.UnsatisfiedLinkError: could not load a native library: netty_tcnative
                    at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:205)
                    at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:85)
                    ... 9 more
            Caused by: java.io.FileNotFoundException: META-INF/native/libnetty_tcnative.a
                    at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:161)
                    ... 10 more
                    Suppressed: java.lang.UnsatisfiedLinkError: netty_tcnative (Not found in java.library.path)
                            at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1425)
                            at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1395)
                            at java.lang.System.loadLibrary(System.java:565)
                            at io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)
                            at io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:243)
                            at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:124)
                            ... 10 more
                            Suppressed: java.lang.UnsatisfiedLinkError: netty_tcnative (Not found in java.library.path)
                                    at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1425)
                                    at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1395)
                                    at java.lang.System.loadLibrary(System.java:565)
                                    at io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
                                    at java.lang.reflect.Method.invoke(Method.java:508)
                                    at io.netty.util.internal.NativeLibraryLoader$1.run(NativeLibraryLoader.java:263)
                                    at java.security.AccessController.doPrivileged(AccessController.java:647)
                                    at io.netty.util.internal.NativeLibraryLoader.loadLibraryByHelper(NativeLibraryLoader.java:255)
                                    at io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:233)
                                    ... 11 more
    
    Feb 17, 2019 3:11:33 AM io.grpc.netty.GrpcSslContexts defaultSslProvider
    INFO: Conscrypt not found (this may be normal)
    Feb 17, 2019 3:11:33 AM 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.forNameImpl(Native Method)
            at java.lang.Class.forName(Class.java:403)
            at io.grpc.netty.JettyTlsUtil.isJettyAlpnConfigured(JettyTlsUtil.java:64)
            at io.grpc.netty.JettyTlsUtil.getJettyAlpnUnavailabilityCause(JettyTlsUtil.java:75)
            at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:255)
            at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:171)
            at io.grpc.netty.GrpcSslContexts.forServer(GrpcSslContexts.java:151)
            at io.grpc.netty.NettyServerBuilder.useTransportSecurity(NettyServerBuilder.java:456)
            at io.grpc.netty.NettyServerBuilder.useTransportSecurity(NettyServerBuilder.java:55)
            at com.ankit.agents.AgentMain.<init>(AgentMain.java:91)
            at com.ankit.agents.AgentMain.main(AgentMain.java:132)
    
    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:256)
            at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:171)
            at io.grpc.netty.GrpcSslContexts.forServer(GrpcSslContexts.java:151)
            at io.grpc.netty.NettyServerBuilder.useTransportSecurity(NettyServerBuilder.java:456)
            at io.grpc.netty.NettyServerBuilder.useTransportSecurity(NettyServerBuilder.java:55)
            at com.ankit.agents.AgentMain.<init>(AgentMain.java:91)
            at com.ankit.agents.AgentMain.main(AgentMain.java:132)
    
    

    However, it is running fine on an Ubuntu machine. I am running the jar as follows: /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/bin/java -jar agent-1.0.jar

    The java version here is:

    $ /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/bin/java -version
    openjdk version "1.8.0_171"
    OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-2~14.04-b11)
    OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)
    

    What is the problem here and how to solve this?

    opened by ankitshubham97 35
  • {Netty,OkHttp}TransportTest.serverNotListening is flaky

    {Netty,OkHttp}TransportTest.serverNotListening is flaky

    https://grpc-testing.appspot.com/job/gRPC-Java-PR-Windows/1439/console

    io.grpc.okhttp.OkHttpTransportTest > serverNotListening FAILED
        Wanted but not invoked:
        listener.transportTerminated();
        -> at io.grpc.internal.testing.AbstractTransportTest.serverNotListening(AbstractTransportTest.java:178)
        Actually, there were zero interactions with this mock.
    
    code health highly flaky 
    opened by ejona86 31
  • server performance issues

    server performance issues

    Hi grpc-java guys, I have wrote some programs to do the performance testing for grpc-java. The service is very simple, just echo the strings (about 400 bytes per request) received from clients. (Actually, I disabled servers' log.) Appears that it's is difficult for me to archive high requests-per-second and low response-time.

    requests-per-second: about 220k (expected: 1000MB/400B) reponse-time: p99 25ms, p999 33ms (expected: p99 below 4ms)

    My environment and configurations are listed as follows.

    Environment: 48 cores/128GB memory/10000Mbps net/CentOS Linux release 7.2.1511 gRPC Version: 1.8.0 JVM options: JDK 1.7.80 -Xms4g -Xmx8g bossGroup: 4 threads workerGroup: 160 threads executor: ThreadPoolExecutor(64, 64, 1000 * 60 * 10, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(65536))

    threaddump.txt

    According to the thread dump, many worker threads stick to SerializingExecutor.

    question 
    opened by xiaoshuang-lu 30
  • Question on Android Requirements

    Question on Android Requirements

    I have a grpc server written in go which serves through a valid https certificate, and an Android client like the examples but without the usePlaintext(true) part.

    The RPC services work fine for Android devices with sdk-version >= 21, but they fail for older devices with this exception:

    io.grpc.StatusRuntimeException: UNAVAILABLE: No provided cause
        at io.grpc.Status.asRuntimeException(Status.java:503)
        at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:207)
        at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:140)
        at net.honarnama.nano.AuthServiceGrpc$AuthServiceBlockingStub.createAccount(AuthServiceGrpc.java:290)
        ... app stack
    Caused by: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xb8adea90: Failure in SSL library, usually a protocol error
    error:140740B5:SSL routines:SSL23_CLIENT_HELLO:no ciphers available (external/openssl/ssl/s23_clnt.c:486 0xac7ba990:0x00000000)
        at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:448)
        at io.grpc.okhttp.OkHttpProtocolNegotiator.negotiate(OkHttpProtocolNegotiator.java:106)
        at io.grpc.okhttp.OkHttpProtocolNegotiator$AndroidNegotiator.negotiate(OkHttpProtocolNegotiator.java:172)
        at io.grpc.okhttp.OkHttpTlsUpgrader.upgrade(OkHttpTlsUpgrader.java:74)
        at io.grpc.okhttp.OkHttpClientTransport$1.run(OkHttpClientTransport.java:345)
        at io.grpc.internal.SerializingExecutor$TaskRunner.run(SerializingExecutor.java:154)
        ... 3 more
    Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xb8adea90: Failure in SSL library, usually a protocol error
    error:140740B5:SSL routines:SSL23_CLIENT_HELLO:no ciphers available (external/openssl/ssl/s23_clnt.c:486 0xac7ba990:0x00000000)
        at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
        at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:405)
        ... 8 more
    

    Using this mechanism I was able to perform the rpc call on an older device, but the suitable Google Play Services version isn't installed on more than half of the devices in my target population. Is there another way to make grpc work on theses devices? Like switching to Netty-based transport? Is there any sample of an android app usig Netty-based transport?

    Thanks in advance

    opened by emojahedi 28
  • Android Gradle Build Errors

    Android Gradle Build Errors

    What version of gRPC-Java are you using?

    1.27.0

    What is your environment?

    macOSCatalina 10.15.3 java version "1.8.0_241" Android Studio 3.5.3 Gradle 6.0.1

    What did you expect to see?

    I have previously encountered some errors when building an android project as shown here but resolved them by using the sample files provided in the examples. That was with a clean Android Studio project and using my actual proto file. I expected to be able to use that same setup to integrate grpc into my actual project and generate the required code.

    What did you see instead?

    When I integrate grpc into my actual project using the same elements from my gradle which worked in the clean project, there are numerous errors which occur no matter what variations I try and use to resolve them.

    Is there a fundamental error in the gradle file as it is being used in my actual project?

    I will provide the gradle files being used in my actual project for reference and then outline some of the errors that occur and the variations I have tried to use to resolve them.

    Steps to reproduce the bug

    Here is the project level gradle file before grpc integration:

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
        ext.kotlin_version = '1.3.61'
        repositories {
            google()
            jcenter()
            maven { url 'https://jitpack.io' }
           
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.5.3'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
            classpath 'com.google.gms:google-services:4.3.2'
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            google()
            jcenter()
            maven { url 'https://jitpack.io' }
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

    Here is the app level gradle file before integrating any grpc items:

    apply plugin: 'com.android.application'
    
    apply plugin: 'kotlin-android'
    
    apply plugin: 'kotlin-android-extensions'
    
    apply plugin: 'com.google.gms.google-services'
    
    
    android {
        compileSdkVersion 29
        defaultConfig {
            applicationId "com.sample.sample"
            minSdkVersion 24
            targetSdkVersion 29
            versionCode 1
            versionName "1.0.0"
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }
    
        dataBinding {
            enabled = true
        }
    
        compileOptions {
            sourceCompatibility 1.8
            targetCompatibility 1.8
        }
    }
    
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
        implementation 'androidx.appcompat:appcompat:1.1.0'
        implementation 'androidx.core:core-ktx:1.2.0'
        implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
        implementation 'com.google.android.material:material:1.2.0-alpha04'
        implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha01'
        implementation 'androidx.legacy:legacy-support-v4:1.0.0'
        implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
        implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
    
        implementation 'com.google.firebase:firebase-auth:19.2.0'
        implementation 'com.firebaseui:firebase-ui-auth:6.0.2'
        implementation 'com.google.gms:google-services:4.3.3'
    
        implementation 'com.google.firebase:firebase-messaging:20.1.0'
        implementation 'com.google.firebase:firebase-storage:19.1.1'
        implementation 'com.google.firebase:firebase-appindexing:19.1.0'
    
        implementation 'com.google.firebase:firebase-dynamic-links:19.0.0'
        implementation 'com.google.firebase:firebase-inappmessaging:19.0.3'
    
        implementation 'com.google.firebase:firebase-ml-vision:24.0.1'
        implementation 'com.google.firebase:firebase-ml-vision-image-label-model:19.0.0'
        implementation 'com.google.firebase:firebase-ml-vision-face-model:19.0.0'
        implementation 'com.google.firebase:firebase-ml-vision-object-detection-model:19.0.3'
        implementation 'com.google.firebase:firebase-ml-vision-automl:18.0.3'
        implementation 'com.google.firebase:firebase-ml-natural-language:22.0.0'
        implementation 'com.google.firebase:firebase-ml-natural-language-language-id-model:20.0.7'
        implementation 'com.google.firebase:firebase-ml-natural-language-translate-model:20.0.7'
        implementation 'com.google.firebase:firebase-ml-natural-language-smart-reply-model:20.0.7'
        implementation 'com.google.firebase:firebase-ml-model-interpreter:22.0.1'
        implementation 'com.google.firebase:firebase-perf:19.0.5'
        implementation 'com.google.firebase:firebase-database:19.2.1'
        implementation 'com.google.firebase:firebase-config:19.1.1'
    
        testImplementation 'junit:junit:4.13'
        androidTestImplementation 'androidx.test:runner:1.2.0'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    
        //sdp
        implementation 'com.intuit.sdp:sdp-android:1.0.6'
    
        //Floating Action Button
        implementation "com.leinardi.android:speed-dial:3.0.0"
    
        implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.2'
    
        implementation 'com.google.code.gson:gson:2.8.6'
        implementation 'androidx.emoji:emoji:1.0.0'
    
        // implementation 'io.github.rockerhieu:emojicon:1.4.1'
        // local storage
        implementation 'io.paperdb:paperdb:2.6'
    
        //Birth date selection view
        implementation 'com.github.BlackBoxVision:material-wheel-view:v0.0.1'
    
    }
    
    apply plugin: 'com.google.gms.google-services'
    
    if (hasProperty('buildScan')) {
        buildScan {
            termsOfServiceUrl = 'https://gradle.com/terms-of-service'
            termsOfServiceAgree = 'yes'
        }
    }
    

    Here are the same two files after integrating grpc as following the format that was running on the clean project with the production proto file:

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
        ext.kotlin_version = '1.3.61'
        repositories {
            google()
            jcenter()
            maven { url 'https://jitpack.io' }
            
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.5.3'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
            classpath 'com.google.gms:google-services:4.3.2'
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
            classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.11"
        }
    }
    
    allprojects {
        repositories {
            google()
            jcenter()
            maven { url 'https://jitpack.io' }
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    
    apply plugin: 'com.android.application'
    
    apply plugin: 'kotlin-android'
    
    apply plugin: 'kotlin-android-extensions'
    
    apply plugin: 'com.google.gms.google-services'
    
    apply plugin: 'com.google.protobuf'
    
    
    android {
        compileSdkVersion 29
        defaultConfig {
            applicationId "com.fhltr.fhltr"
            minSdkVersion 24
            targetSdkVersion 29
            versionCode 1
            versionName "1.0.0"
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }
    
        dataBinding {
            enabled = true
        }
    
        compileOptions {
            sourceCompatibility 1.8
            targetCompatibility 1.8
        }
    }
    
    protobuf {
        protoc { artifact = 'com.google.protobuf:protoc:3.11.0' }
        plugins {
            grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.27.0' // CURRENT_GRPC_VERSION
            }
        }
        generateProtoTasks {
            all().each { task ->
                task.builtins {
                    java { option 'lite' }
                }
                task.plugins {
                    grpc { // Options added to --grpc_out
                        option 'lite' }
                }
            }
        }
    }
    
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
        implementation 'androidx.appcompat:appcompat:1.1.0'
        implementation 'androidx.core:core-ktx:1.2.0'
        implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
        implementation 'com.google.android.material:material:1.2.0-alpha04'
        implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha01'
        implementation 'androidx.legacy:legacy-support-v4:1.0.0'
        implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
        implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
    
        implementation 'com.google.firebase:firebase-auth:19.2.0'
        implementation 'com.firebaseui:firebase-ui-auth:6.0.2'
        implementation 'com.google.gms:google-services:4.3.3'
    
        implementation 'com.google.firebase:firebase-messaging:20.1.0'
        implementation 'com.google.firebase:firebase-storage:19.1.1'
        implementation 'com.google.firebase:firebase-appindexing:19.1.0'
    
    
        //Put below library to solve crash issue
        // implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
        //implementation 'com.google.firebase:firebase-inappmessaging-display:19.0.2'
    
        implementation 'com.google.firebase:firebase-dynamic-links:19.0.0'
        implementation 'com.google.firebase:firebase-inappmessaging:19.0.3'
    
        implementation 'com.google.firebase:firebase-ml-vision:24.0.1'
        implementation 'com.google.firebase:firebase-ml-vision-image-label-model:19.0.0'
        implementation 'com.google.firebase:firebase-ml-vision-face-model:19.0.0'
        implementation 'com.google.firebase:firebase-ml-vision-object-detection-model:19.0.3'
        implementation 'com.google.firebase:firebase-ml-vision-automl:18.0.3'
        implementation 'com.google.firebase:firebase-ml-natural-language:22.0.0'
        implementation 'com.google.firebase:firebase-ml-natural-language-language-id-model:20.0.7'
        implementation 'com.google.firebase:firebase-ml-natural-language-translate-model:20.0.7'
        implementation 'com.google.firebase:firebase-ml-natural-language-smart-reply-model:20.0.7'
        implementation 'com.google.firebase:firebase-ml-model-interpreter:22.0.1'
        implementation 'com.google.firebase:firebase-perf:19.0.5'
        implementation 'com.google.firebase:firebase-database:19.2.1'
        implementation 'com.google.firebase:firebase-config:19.1.1'
    
        testImplementation 'junit:junit:4.13'
        androidTestImplementation 'androidx.test:runner:1.2.0'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    
        //sdp
        implementation 'com.intuit.sdp:sdp-android:1.0.6'
    
        //Floating Action Button
        implementation "com.leinardi.android:speed-dial:3.0.0"
    
        implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.2'
    
        implementation 'com.google.code.gson:gson:2.8.6'
        implementation 'androidx.emoji:emoji:1.0.0'
    
        // implementation 'io.github.rockerhieu:emojicon:1.4.1'
        // local storage
        implementation 'io.paperdb:paperdb:2.6'
    
        //Birth date selection view
        implementation 'com.github.BlackBoxVision:material-wheel-view:v0.0.1'
    
        implementation 'javax.annotation:javax.annotation-api:1.3.2'
    
        implementation 'io.grpc:grpc-protobuf-lite:1.27.0' // CURRENT_GRPC_VERSION
        implementation 'io.grpc:grpc-stub:1.27.0' // CURRENT_GRPC_VERSION
    
        implementation 'io.grpc:grpc-cronet:1.24.0'
        implementation 'com.google.android.gms:play-services-cronet:17.0.0'
    
    }
    
    if (hasProperty('buildScan')) {
        buildScan {
            termsOfServiceUrl = 'https://gradle.com/terms-of-service'
            termsOfServiceAgree = 'yes'
        }
    }
    
    question 
    opened by z9fyak74amnjbvcyn4t2g 27
  • Resource leak in v0.9.0 and v0.12.0

    Resource leak in v0.9.0 and v0.12.0

    After running GRPC for a while I get the following error (with io.netty.leakDetection.level=advanced):

    LEAK: ByteBuf.release() was not called before it's garbage-collected. See http://netty.io/wiki/reference-counted-objects.html for more information.
    Recent access records: 1
    #1:
        Hint: 'DefaultChannelPipeline$HeadContext#0' will handle the message from this point.
        io.netty.buffer.CompositeByteBuf.touch(CompositeByteBuf.java:1615)
        io.netty.buffer.CompositeByteBuf.touch(CompositeByteBuf.java:42)
        io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:264)
        io.netty.handler.codec.http2.DefaultHttp2FrameWriter.writeData(DefaultHttp2FrameWriter.java:142)
        io.netty.handler.codec.http2.Http2OutboundFrameLogger.writeData(Http2OutboundFrameLogger.java:42)
        io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder$FlowControlledData.write(DefaultHttp2ConnectionEncoder.java:356)
        io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController$DefaultState.write(DefaultHttp2RemoteFlowController.java:674)
        io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController$DefaultState.writeBytes(DefaultHttp2RemoteFlowController.java:645)
        io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController$DefaultState.writeAllocatedBytes(DefaultHttp2RemoteFlowController.java:544)
        io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController$1.visit(DefaultHttp2RemoteFlowController.java:44)
        io.netty.handler.codec.http2.DefaultHttp2Connection$ActiveStreams.forEachActiveStream(DefaultHttp2Connection.java:1100)
        io.netty.handler.codec.http2.DefaultHttp2Connection.forEachActiveStream(DefaultHttp2Connection.java:135)
        io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController.writePendingBytes(DefaultHttp2RemoteFlowController.java:310)
        io.netty.handler.codec.http2.Http2ConnectionHandler.flush(Http2ConnectionHandler.java:204)
        io.netty.channel.ChannelHandlerInvokerUtil.invokeFlushNow(ChannelHandlerInvokerUtil.java:165)
        io.netty.channel.DefaultChannelHandlerInvoker.invokeFlush(DefaultChannelHandlerInvoker.java:355)
        io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:272)
        io.netty.channel.DefaultChannelPipeline.flush(DefaultChannelPipeline.java:997)
        io.netty.channel.AbstractChannel.flush(AbstractChannel.java:226)
        io.grpc.netty.WriteQueue.flush(WriteQueue.java:131)
        io.grpc.netty.WriteQueue.access$000(WriteQueue.java:48)
        io.grpc.netty.WriteQueue$1.run(WriteQueue.java:58)
        io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:339)
        io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:356)
        io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        java.lang.Thread.run(Thread.java:745)
    Created at:
        io.netty.buffer.CompositeByteBuf.<init>(CompositeByteBuf.java:63)
        io.netty.buffer.AbstractByteBufAllocator.compositeDirectBuffer(AbstractByteBufAllocator.java:193)
        io.netty.buffer.AbstractByteBufAllocator.compositeBuffer(AbstractByteBufAllocator.java:171)
        io.netty.channel.CoalescingBufferQueue.compose(CoalescingBufferQueue.java:156)
        io.netty.channel.CoalescingBufferQueue.remove(CoalescingBufferQueue.java:132)
        io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder$FlowControlledData.write(DefaultHttp2ConnectionEncoder.java:351)
        io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController$DefaultState.write(DefaultHttp2RemoteFlowController.java:674)
        io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController$DefaultState.writeBytes(DefaultHttp2RemoteFlowController.java:645)
        io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController$DefaultState.writeAllocatedBytes(DefaultHttp2RemoteFlowController.java:544)
        io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController$1.visit(DefaultHttp2RemoteFlowController.java:44)
        io.netty.handler.codec.http2.DefaultHttp2Connection$ActiveStreams.forEachActiveStream(DefaultHttp2Connection.java:1100)
        io.netty.handler.codec.http2.DefaultHttp2Connection.forEachActiveStream(DefaultHttp2Connection.java:135)
        io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController.writePendingBytes(DefaultHttp2RemoteFlowController.java:310)
        io.netty.handler.codec.http2.Http2ConnectionHandler.flush(Http2ConnectionHandler.java:204)
        io.netty.channel.ChannelHandlerInvokerUtil.invokeFlushNow(ChannelHandlerInvokerUtil.java:165)
        io.netty.channel.DefaultChannelHandlerInvoker.invokeFlush(DefaultChannelHandlerInvoker.java:355)
        io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:272)
        io.netty.channel.DefaultChannelPipeline.flush(DefaultChannelPipeline.java:997)
        io.netty.channel.AbstractChannel.flush(AbstractChannel.java:226)
        io.grpc.netty.WriteQueue.flush(WriteQueue.java:131)
        io.grpc.netty.WriteQueue.access$000(WriteQueue.java:48)
        io.grpc.netty.WriteQueue$1.run(WriteQueue.java:58)
        io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:339)
        io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:356)
        io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        java.lang.Thread.run(Thread.java:745)
    

    This looks similar to #336 but not quite identical. This happens on a 64-bit Linux machine running Oracle Java 1.8.0. I'm happy to provide more information if required.

    opened by unlikely-leo 27
  • Extend the xDS interop tests timeout to 360 mins

    Extend the xDS interop tests timeout to 360 mins

    Related https://github.com/grpc/grpc/pull/26090

    With config update timeout pushed to 600s, we might need longer Kokoro build timeout as well.

    opened by lidizheng 0
  • examples: export the manualflowcontrol example to the bin output folder

    examples: export the manualflowcontrol example to the bin output folder

    This PR will output the Flow control example client & server to:

    • ./examples/build/install/examples/bin/manual-flow-control-client
    • ./examples/build/install/examples/bin/manual-flow-control-server

    The examples README.md states that the script should be present, but it currently isn't.

    This PR improves gRPC to honour the examples README.md and to quickly find out this example exists, instead of having to go through the source code.

    opened by JorisEdia 1
  • Re-enable previously disabled aarch64 tests

    Re-enable previously disabled aarch64 tests

    Based on https://github.com/grpc/grpc-java/pull/8126 (only the last commit is the actual change).

    My experiments show that after upgrading netty-tcnative-boringssl-static, the tests are reasonably stable (i got a few consecutive passing runs).

    opened by jtattermusch 2
  • Upgrade netty-tcnative-boringssl-static to 2.0.35.Final

    Upgrade netty-tcnative-boringssl-static to 2.0.35.Final

    Should fix https://github.com/grpc/grpc-java/issues/7830 (as per the analysis here: https://github.com/grpc/grpc-java/issues/7830#issuecomment-828851471)

    Related PR from other contributor https://github.com/grpc/grpc-java/pull/7979 (which is likely superseded by this PR?)

    opened by jtattermusch 1
  • about grpc client call server overtime question

    about grpc client call server overtime question

    first use grpc how set the grpc client call server overtime

    question 
    opened by No-Silver-J 1
  • Request received RST when nginx reload

    Request received RST when nginx reload

    What version of gRPC-Java are you using?

    1.35.0

    What is your environment?

    Client: Windows 10/ JDK 8 Server: k8s 1.14.8 cluster / tensorflow serving 2.0 / ingress-nginx 0.19, nginx version 1.15.3

    What did you expect to see?

    When continuously requests a grpc server (tensorflow serving) behind nginx with for loop, the nginx is reloading. nginx fork new sub process to handle new request, the prior sub process exit util the current request finish, then client stub will create a new channel/connection to process remain requests.

    For example, When python client sends a request to the grpc server, nginx will produce a FIN/PSH/ACK flag packet before sub process exited. Then the client will send FIN/ACK to nginx and close the request. Finally, python grpc client will reconnect to nginx to handle the remaining requests.

    What did you see instead?

    When nginx reloaded, the prior sub process log 200 OK to nginx access_log, while the grpc-java client threw an exception below:

    Sending GOAWAY failed: lastStreamId '0', errorCode '2', debugData ''. Forcing shutdown of the connection.
    
    UNAVAILABLE: Connection closed after GOAWAY. HTTP/2 error code: NO_ERROR
    

    nginx sent RST flag packet to java client and has no FIN flag packet when use wireshark captured the tcp packet.

    Steps to reproduce the bug

    1. use for loop to request a grpc server continuously (like tensorflow serving) behind nginx
    2. reloading nginx at the same time
    opened by levinxo 3
  • Inconsistent server-side error in ServerStreamTracer vs ServerInterceptor

    Inconsistent server-side error in ServerStreamTracer vs ServerInterceptor

    What version of gRPC-Java are you using?

    1.37.0

    What is your environment?

    Linux, OpenJDK 1.8 openjdk version "1.8.0_282" OpenJDK Runtime Environment (build 1.8.0_282-8u282-b08-0ubuntu1~20.04-b08) OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)

    What did you expect to see?

    In a bidirectional streaming service, I'm observing different a status passed to ServerCall.close(Status, Metadata) versus the status passed to ServerStreamTracer.streamClosed(Status) when a misbehaving client is abruptly terminating the connection (without sending any sort of cancel or reset).

    What did you see instead?

    The server has a logging interceptor which intercepts the ServerCall.close(Status, Metadata) method and logs the status. The status seen here is Status{code=CANCELLED, description=Cancelling request because of error from client., cause=null}. We also have a ServerStreamTracer installed on the server, but the Status passed to ServerStreamTracer.streamClosed(Status) is Status{code=UNAVAILABLE, description=connection terminated for unknown reason, cause=null}.

    Steps to reproduce the bug

    I have a minimal reproducer with some instructions here.

    Comments

    If the client is terminating the connection then I suppose there really is no true status (either from the server or from the client). So I could be convinced that either of these Status codes would be valid. What really threw off our metrics and sent a couple of engineers down a debugging rabbit hole is that we couldn't correlate any request logs on the server (being logged from the ServerInterceptor) with the status metrics being emitted from the ServerStreamTracer. So I think regardless of what Status is ultimately reported for a abruptly closed connection, it should at least be consistent between these two sources.

    This may also be related to #7558 .

    opened by JackOfMostTrades 4
  • Move protoc aarch64 artifact build to linux_aarch64 job

    Move protoc aarch64 artifact build to linux_aarch64 job

    Followup for https://github.com/grpc/grpc-java/pull/8113.

    We should only merge this once the linux_aarch64 job is reliably green (otherwise we could negatively affect the release process).

    opened by jtattermusch 0
  • deps: update protobuf to 3.15.8

    deps: update protobuf to 3.15.8

    @ejona86

    opened by elharo 3
Releases(v1.37.0)
  • v1.37.0(Apr 8, 2021)

    Behavior Changes

    • alts: make both GoogleDefaultChannelCredentials and ComputeEngineChannelCredentials choose ALTS for backends given by xDS TD. Changes for ComputeEngineChannelCredentials were missing, but they really should be the same.
    • api: added a convenient ServerBuilder.addServices() API that allows adding a list of services instead of iterating through list and calling addService().
    • api: deleted some NameResolver APIs that have been marked as deprecated since 1.21 release.
    • api: implemented admin interface API, which automatically loads available admin services in a given binary. Currently, it only includes Channelz and CSDS with dependencies required at runtime.
    • context: move pendingDeadline.cancel out of synchronized block.
    • netty: allow connection handshakes (e.g., TCP, TLS) to be interrupted by channel.shutdown(). Previously shutdownNow() was required for prompt shutdown if a connection was handshaking.
    • xds: change in parsing ADS responses for LDS, RDS, CDS, and EDS resources. Before this release, gRPC parsing logic for ADS response containing multiple resources was to stop resource processing on the first encountered error, followed by NACK with the details of this single error. With this change, the parsing logic processes all resources and collects all processing errors. If any error occurred, a NACK is issued with concatenated error messages of all errors encountered. The rationale and the detailed design can be found in gRFC A40 — ADS Parsing Logic Update: Continue After First Error.
    • xds: change system property name for reading bootstrap config from io.grpc.xds.bootstrapValue to io.grpc.xds.bootstrapConfig.
    • xds: circuit breaking, timeout and fault injection are enabled by default. Previously they were protected by environment variables.
    • xds: use the new server_listener_resource_name_template property from the bootstrap file for server side xDS processing as per the gRFC A36-xds-for-servers.md.

    New Features

    • api: TlsChannelCredentials and TlsServerCredentials now support client certificates and custom KeyManagers/TrustManagers. grpc-netty fully supports these options. grpc-okhttp does not support keyfile-based configuration; you’d need to use a KeyManager. Most users of Netty’s SslContext and GrpcSslContexts should be able to migrate and are encouraged to do so, because this API does not have a Netty dependency and so is planned to become stable.
    • netty: added support for OpenJSSE.
    • okhttp: support compiling with okio 2.x API for Bazel users. grpc-okhttp was already compatible with okio 2 at runtime.
    • xds: XdsServingStatusListener has been implemented as per the gRFC A36-xds-for-servers.md.
    • xds: add proto leakage check at gradle build. Create a new Gradle task depends on shadowJar. It examines the outputs of shadowJar package prefix to make sure it is inside within the package.
    • xds: added CsdsService. It is safe for production but are Experimental APIs to resolve issues discovered as they see usage. The rationale and description of the new API can be found in gRFC A40: xDS Configuration Dump via Client Status Discovery Service in gRPC.
    • xds: implement gRPC server side validations and filterChain match of xDS configuration as per the gRFC A36-xds-for-servers.md.
    • xds: WeightedTargetLoadBalancer collect all failure child pickers to log more error details.

    Bug Fixes

    • grpclb: gRPCLB would buffer RPCs indefinitely if failing to fallback because the resolver provides no fallback addresses. Now it turns into TRANSIENT_FAILURE for such cases.
    • xds: fix CdsLoadBalancer2 childLb shutdown behavior. Previously these childLbs are not properly shutdown, which might cause channel panic as client channel is referenced by those childLbs.
    • Fixed an UnsupportedOperationException incompatibility with Netty 4.1.60.Final (#7953). This allows users of grpc-netty that may be using Netty elsewhere in their application to upgrade their Netty version to avoid exposure to recent Netty CVEs. gRPC itself is not impacted by those CVEs.
    • grpclb: fixed a race between address update and LB stream recreation, which would cause channel panic if the resolver refreshes the result while gRPCLB is in LB stream backoff.
    • grpclb: gRPCLB ignored CONNECTING subchannels when aggregating the overall LB state, which would cause RPCs to fail prematurely if there are subchannels in its initial connection.
    • grpclb: now we allow multiple authorities in lb backends instead of flattening to the first authority.
    • interop-testing: fix alts handshaking race: add proper synchronization on the AltsTestServer object lock, this way, alts client and alts server won’t race on the AltsTestServer during Alts handshake negotiation.
    • xds: fixed a bug that would drop some node information (e.g., user-agent) when reporting to LRS (#7964).
    • xds: the xDS resolver did not clear its state when control plane resources were revoked before offloading the xDS LB plugin. It would treat the next update as duplicate if the control plane recovers and never comes back to use those resources. Now this is fixed.

    Documentation

    • example-tls: ported to TlsChannelCredentials/TlsServerCredentials and no longer depends on Netty at compile time.
    • examples: add ALTS example README.md.

    Dependencies

    • gradle: bumped protobuf-gradle-plugin version to 0.8.15
    • xds: envoy proto updated to commit ac9a26373. Added xDS v3 csds.proto with dependencies.

    Acknowledgements

    @spkrka Kristofer Karlsson @njhill Nick Hill @ulfjack Ulf Adams

    Source code(tar.gz)
    Source code(zip)
  • v1.36.1(Mar 25, 2021)

    • Fix an UnsupportedOperationException incompatibility with Netty 4.1.60.Final (#7953). This allows users of grpc-netty that may be using Netty elsewhere in their application to upgrade their Netty version to avoid exposure to recent Netty CVEs. gRPC is not impacted by those CVEs so a Netty upgrade for gRPC itself is not necessary
    • xds: Fixed a bug that would drop some node information (e.g., user-agent) when reporting to LRS (#7964)
    • xds: Renamed io.grpc.xds.bootstrapValue system property to io.grpc.xds.bootstrapConfig. This more closely matches the environment variable (GRPC_XDS_BOOTSTRAP_CONFIG) and avoids future confusion (#7968)
    • xds: Fixed a possible IllegalStateException causing Channel panic during LB shutdown (#7942). The bug was introduced in v1.36.0. The issue likely most impacts xDS users that may leave a channel unused (no RPCs) for 30 minutes since idle timeout triggers LB shutdown
    Source code(tar.gz)
    Source code(zip)
  • v1.35.1(Mar 25, 2021)

    • Fix an UnsupportedOperationException incompatibility with Netty 4.1.60.Final (#7953). This allows users of grpc-netty that may be using Netty elsewhere in their application to upgrade their Netty version to avoid exposure to recent Netty CVEs. gRPC is not impacted by those CVEs so a Netty upgrade for gRPC itself is not necessary
    • xds: Fixed a bug that would drop some node information (e.g., user-agent) when reporting to LRS (#7964)
    Source code(tar.gz)
    Source code(zip)
  • v1.32.3(Mar 15, 2021)

    Bug Fixes

    • xds: Fixed JSON number types in internally generated service config for header matching (more specifically, range matching for numerical headers) (#7880).
    Source code(tar.gz)
    Source code(zip)
  • v1.31.2(Mar 15, 2021)

    Bug Fixes

    • xds: Fixed JSON number types in internally generated service config for header matching (more specifically, range matching for numerical headers) (#7884).
    Source code(tar.gz)
    Source code(zip)
  • v1.36.0(Feb 23, 2021)

    API Changes

    • Added .class file hack to ease removal of internal ABIs (https://github.com/grpc/grpc-java/pull/7834). This does not impact source code (API); it only impacts code compiled with a different version of gRPC than it runs with (ABI). Users of the transport-specific and experimental channel/server builders (NettyChannelBuilder, NettyServerBuilder, OkHttpChannelBuilder, InProcessChannelBuilder, CronetChannelBuilder) are commonly referencing internal ABIs due to overly-specific generics in gRPC. There is now a .class file hack in place which preserves ABI compatibility for old builds while causing javac to use the intended public API for new builds. In a future release we will remove the internal ABI for these experimental APIs (https://github.com/grpc/grpc-java/issues/7211) which may cause runtime failures. Recompiling with this release or later will prevent your code from using those ABIs and so you will not be impacted by the ABI removal. This is related to the temporary ABI breakage in v1.33.0.
    • Deleted deprecated LoadBalancer.Helper APIs as they had been deprecated since v1.22 release (#7793).
    • Deprecated LoadBalancer.Helper.createResolvingOobChannelBuilder(String target) in favor of the new experimental API createResolvingOobChannelBuilder(String target, ChannelCredentials creds). The two APIs differ not only in signature but also in the default authority of the returned builder. See their javadoc for more detail.

    Behavior Changes

    • ManagedChannelBuilder.overrideAuthority() is now used even if the NameResolver uses EquivalentAddressGroup.ATTR_AUTHORITY_OVERRIDE. Previously the NameResolver’s override would be used
    • grpclb: keep RR Subchannel state in TRANSIENT_FAILURE until becoming READY (#7816). This enhancement was previously made to the round_robin policy, but now also applies to grpclb
    • netty: On server-side, stop logging expected STREAM_CLOSED exceptions. This reduces log pollution

    New Features

    • services: Add support for grpc.channelz.v1.Channelz.GetServer, as defined in channelz.proto
    • xds: support reading bootstrap config directly from env var (GRPC_XDS_BOOTSTRAP_CONFIG) or system property (io.grpc.xds.bootstrapValue) values
    • alts: Introduce AltsContext to allow outside packages access to ALTS peer information

    Bug Fixes

    • core: Fixed a bug where RPCs queued waiting for a connection can use user-provided executors after the ManagedChannel is terminated (#6283)
    • core: Fixed a bug where RPCs queued waiting on CallCredentials can use user-provided executors after the ManagedChannel is terminated (#7813)

    Documentation

    • api: add nullable annotation to Status.trailersFromThrowable (#7856). The annotation doesn’t change behavior, it just makes the behavior more clear

    Dependencies

    • alts: Remove dependency on Apache Commons Lang

    Acknowledgements

    @elharo Elliotte Rusty Harold @lriuui0x0 Rui Liu @martin-schaub Martin Schaub @njhill Nick Hill @ReginFell Serhii Zabelnykov

    Source code(tar.gz)
    Source code(zip)
  • v1.35.0(Jan 13, 2021)

    Bug Fixes

    • core: Fix CompositeChannelCredentials to no longer use CallCredentials for OOB channels. OOB channels are available for load balancing policies to use to communicate with an LB server. It is mainly used by gRPC-LB. This resolves the incompatibility of the 1.34.0 release with googleapis.com.
    • alts: Limit number of concurrent handshakes to 32. ALTS uses blocking RPCs for handshakes. If the handshake server has a limit to number of concurrent handshakes this can produce a deadlock. Limiting to 32 should workaround the problem for the majority of the cases. A later fix will allow handshake RPCs to be asynchronous
    • xds: Fix missed class relocations for generated code. grpc-xds previously exposed generated code for multiple 3rd-party protobuf generated code classes outside of the io.grpc package. They are now shaded to avoid colliding with other users of the classes
    • xds: Fix a user visible stack trace showing java.util.NoSuchElementException when the environment variable GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT was set and the application contains an xDS configured gRPC server. The exception was benign and was seen when the connection was dropped before an SslContextProvider was available.
    • xds: Decouple xds channel creation and bootstrapping. This fixes the bug caused by the lifecycle mismatch between XdsClient and its channel to the xDS server. Creating a new XdsClient (previous one shutdown due to no Channel using it) would create and use a new xDS channel.
    • xds: Fix races between creating subchannls and Channel shutdown caused by delaying address/config propagation between LB policies. An exception will be thrown if Channel's shutdown() has been called and receiving an EDS update while the Channel has not completely shutdown.

    Dependencies

    • Guava updated to 30.0-android
    • Animal Sniffer annotations updated to 1.19
    • Error Prone annotations updated to 2.4.0
    • Perfmark updated to 0.23.0
    • compiler: Linux artifacts now built using CentOS 7. Previously CentOS 6 was used, but that distribution is discontinued and no longer available in our build infrastructure
    • netty: Upgrade to Netty 4.1.52 and tcnative 2.0.34. Note that this Netty release enables TLSv1.3 support. mTLS failures with TLSv1.3 will have different error messages than in TLSv1.2
    • auth,alts: google-auth-library-java updated to 0.22.2
    • census: OpenCensus updated to 0.28.0
    • protobuf: googleapi’s common protos updated to 2.0.1
    • okhttp: Okio updated to 1.17.5
    • xds: re2j updated to 1.5
    • xds: bouncycastle updated to 1.67
    • gradle: bumped protobuf-gradle-plugin version to 0.8.14
    • android, cronet: upgraded the latest support Android version to 29

    Acknowledgments

    @amnox @horizonzy @wanyingd1996

    Source code(tar.gz)
    Source code(zip)
  • v1.34.1(Dec 15, 2020)

    Bug Fixes

    • core: Fix CompositeChannelCredentials to no longer use CallCredentials for OOB channels. OOB channels are available for load balancing policies to use to communicate with an LB server. It is mainly used by gRPC-LB. This resolves the incompatibility of the 1.34.0 release with googleapis.com.
    • alts: Limit number of concurrent handshakes to 32. ALTS uses blocking RPCs for handshakes. If the handshake server has a limit to number of concurrent handshakes this can produce a deadlock. Limiting to 32 should workaround the problem for the majority of the cases. A later fix will allow handshake RPCs to be asynchronous
    • xds: Relocate (shade) all generated code; a few classes had previously been missed
    • xds: Fixed an issue when GRPC_XDS_EXPERIMENTAL_NEW_SERVER_API=true where gRPC would request non-existent resources
    Source code(tar.gz)
    Source code(zip)
  • v1.34.0(Dec 1, 2020)

    This release has a severe bug when using CompositeChannelCredentials that predominantly impacts googleapis.com (#7643). You may be impacted in the future even if not impacted today. If you contact googleapis.com, please use 1.34.1 instead.

    API Changes

    • api: added io.grpc.ForwardingServerBuilder (#7633)

    New Features

    • Added ChannelCredentials and ServerCredentials. They are safe for production but are Experimental APIs to resolve issues discovered as they see usage. The rationale and description of the new API can be found in gRFC L74. In short, these APIs are intended to “replace” the implicit security defaults of channels/servers as well as the usePlaintext() and useTransportSecurity() methods on the channel and server builders. The previous APIs are stable so will not be removed, but are expected to be deprecated in the future. Since these new APIs will be widely used, we encourage users to try the APIs out and report any problems experienced so they can be corrected before the APIs become stable (#7294, #7601)
    • As part of ChannelCredentials and ServerCredentials there are now XdsChannelCredentials and XdsServerCredentials added that can be used to enable use of XDS provided credentials on the channel and server. A File-watcher certificate provider has been implemented to support these Xds Credentials. The example in example-xds has been enhanced to be a full xDS example with XdsChannelCredentials and XdsServerCredentials to illustrate their usage. (#7497, #7636)
    • xds: added support for setting bootstrap file with java system property (#7620)

    Bug Fixes

    • netty: abrupt GOAWAY should not cause INTERNAL status. It is now UNAVAILABLE. This was a regression introduced in v1.33.0. The error was in the form StatusRuntimeException: INTERNAL: http2 exception with a cause similar to Http2Exception$StreamException: Cannot create stream 222691 greater than Last-Stream-ID 222689 from GOAWAY. This was mainly observed when a C core-based gRPC server shut down. (#7501)
    • core, netty, okhttp, cronet: fixed builders ABI backward compatibility broken in v1.33.0 (#7552). For details, see v1.33.1 release note.
    • core: round robin should ignore name resolution error for channel state change when there are READY subchannels (#7595). Previously the round_robin load balancing policy puts the Channel into TRANSIENT_FAILURE if encountering name resolution failures even if it has received usable addresses.
    • core: fixed floating-point number formatting Locale in error messages (#7473)
    • android: make Channel always enterIdle() upon network recover (#7611). This is for AndroidChannelBuilder. It avoids failing new RPCs prematurely when the device detects the network has recovered while resuming connections.
    • xds: only reschedule time for unresolved resources upon ADS stream restarts (#7582). The management server can choose not to send resources it has previously sent when the RPC stream is recreated. So the client will keep using resources it has saved previously.
    • alts: create handshaker RPC lazily (#7630). Previously the handshake RPCs start before the TCP connection is established, which might be leaked forever if the connection is never established.

    Documentation

    • api: added implementation note regarding server interceptors and thread locals (#7482)
    • api: clarify expectations regarding ServerCall#close (#7580)

    Behavior Changes

    • netty: differentiate GOAWAY closure status descriptions (#7502). Previously many different GOAWAY-related errors all produced the same status description. Now they each should use their own specific description which should allow distinguishing between issues like weak server GOAWAY behavior, MAX_CONCURRENT_STREAMS interfering with eager transport selection, and local races. We now also use UNAVAILABLE in more cases, although the cases that benefit should be rare
    • xds: added support case insensitive path matching (#7506). The xDS traffic splitting now supports the case-insensitive option for path matching.
    • alts: add a timeout to AltsHandshakerStub. A default of 20 seconds is used (#7589)

    Dependencies

    • all: bumped google auth libraries to version 0.22.0 (#6652)

    Acknowledgements

    @attila123 @erikjoh @jbdeboer @ST-DDT @sullis @susinmotion

    Source code(tar.gz)
    Source code(zip)
  • v1.33.1(Nov 2, 2020)

    Bug Fixes

    • Fix builders ABI backward compatibility broken in v1.33.0, see #7552
      • netty: The class io.grpc.netty.NettyServerBuilder reverted to extend internal class io.grpc.internal.AbstractServerImplBuilder
      • netty: The class io.grpc.netty.NettyChannelBuilder reverted to extend internal class io.grpc.internal.AbstractManagedChannelImplBuilder
      • okhttp: The class io.grpc.okhttp.OkhttpChannelBuilder reverted to extend internal class io.grpc.internal.AbstractManagedChannelImplBuilder
      • core: The class io.grpc.inprocess.InProcessChannelBuilder reverted to extend internal class io.grpc.internal.AbstractManagedChannelImplBuilder
      • cronet: The class io.grpc.cronet.CronetChannelBuilder reverted to extend internal class io.grpc.internal.AbstractManagedChannelImplBuilder
    • api: ForwardingServerBuilder reverted until the permanent fix of the issue with ABI compatibility of delegating classes
    • okhttp: exclude Internal* from javadoc
    • netty: Abrupt GOAWAY should not cause INTERNAL status. It is now UNAVAILABLE. This was a regression introduced in v1.33.0. The error was in the form StatusRuntimeException: INTERNAL: http2 exception with a cause similar to Http2Exception$StreamException: Cannot create stream 222691 greater than Last-Stream-ID 222689 from GOAWAY. This was mainly observed when a C core-based gRPC server shut down.
    • core: fix floating-point number formatting Locale
    Source code(tar.gz)
    Source code(zip)
  • v1.33.0(Oct 20, 2020)

    This release broke ABI in a non-planned way for NettyServerBuilder, NettyChannelBuilder, and similar. See https://github.com/grpc/grpc-java/issues/7552. If you are impacted, please use an earlier version until v1.33.1 is available. A future ABI breakage may be necessary, but will be communicated explicitly at that time.

    API Changes

    • netty: The class io.grpc.netty.NettyServerBuilder is no longer a subclass of the internal class io.grpc.internal.AbstractServerImplBuilder
    • netty: The class io.grpc.netty.NettyChannelBuilder is no longer a subclass of the internal class io.grpc.internal.AbstractManagedChannelImplBuilder
    • okhttp: The class io.grpc.okhttp.OkhttpChannelBuilder is no longer a subclass of the internal class io.grpc.internal.AbstractManagedChannelImplBuilder
    • core: The class io.grpc.inprocess.InProcessChannelBuilder is no longer a subclass of the internal class io.grpc.internal.AbstractManagedChannelImplBuilder
    • cronet: The class io.grpc.cronet.CronetChannelBuilder is no longer a subclass of the internal class io.grpc.internal.AbstractManagedChannelImplBuilder
    • api: Add ForwardingServerBuilder: a ServerBuilder that delegates to another builder by default
    • core: Add accessor for bare method name in MethodDescriptor (#7339)
    • stub: On server-side when an RPC is cancelled, only throw StatusRuntimeException: CANCELLED from onNext() for streaming responses. Previously the exception was also thrown from onNext() for unary responses and from onComplete(), which didn’t help the server avoid unnecessary processing
    • okhttp: OkHttpChannelBuilder made final and can no longer be anonymous
    • api, core: delete io.grpc.LoadBalancer.loadBalancingConfig attribute (#7440). The attribute was deprecated in v1.27.0, now it is completely deleted.

    New Features

    • netty: Add support for IBMJSSE2 (#7422)

    Documentation

    • API documentation (Javadoc) for Server and Channel builders now correctly displays inherited methods and the class hierarchy

    Bug Fixes

    • core: Reverted "delay sending cancel request on client-side when deadline expires" which introduced a memory leak (#7105). It could also cause messages to arrive after the call was reported closed (e.g., onMessage() after onClose())
    • grpclb: Fixed a bug that RPC might be hanging when using grpclb balancer as a child balancer in a hierarchical load balancer tree (#7434)
    • netty: TCP close during TLS handshake should be UNAVAILABLE, not UNKNOWN
    • netty: BDP ping accounting should occur after flow control. This resolves an incompatibility issue introduced in v1.30.0 and could be worked around via GRPC_EXPERIMENTAL_AUTOFLOWCONTROL=false introduced later. The symptom was a GOAWAY with “too_many_pings” without an aggressive keepalive configured. The environment variable is still available, but will be removed in the future

    Behavior Changes

    • xds: Xds server channel credential option will be required in the xDS bootstrap file. Use {"type":"insecure"}” for plaintext (#7396)

    Dependencies

    • benchmarks: Removed -javaagent jvm option in CreateStartScripts, to allow running the benchmarks without building from source
    • Upgrade Conscrypt to 2.5.1
    • bazel: Remove Maven repositories from repositories.bzl, in favor of maven_install. v1.27.0 introduced support for maven_install and encouraged users to migrate. See examples/WORKSPACE for an example. maven_install dramatically reduces the boilerplate for maven dependencies and properly handles transitive dependencies and version selection. gRPC is not yet using the @maven workspace, so it is still possible to use other dependency tools.
    • Update protobuf gradle plugin version to 0.8.13 (#7355)

    Acknowledgements

    @codeblooded Benjamin Reed @kiwi1969 Russell Shaw @pkern Philipp Kern

    Source code(tar.gz)
    Source code(zip)
  • v1.32.2(Oct 12, 2020)

    Bug Fixes

    • netty: TCP close during TLS handshake should be UNAVAILABLE, not UNKNOWN
    • netty: BDP ping accounting should occur after flow control. This resolves an incompatibility issue introduced in v1.30.0 and could be worked around via GRPC_EXPERIMENTAL_AUTOFLOWCONTROL=false introduced later. The symptom was a GOAWAY with “too_many_pings” without an aggressive keepalive configured. The environment variable is still available, but will be removed in the future
    • alts: Reverted workaround for Conscrypt cipher performance. Conscrypt 2.5.0 has significantly improved performance and the workaround now decreases performance. Note that grpc-alts itself still depends on Conscrypt 2.2.1 to remain stable for this bug fix release, but users are encouraged to use newer a version of Conscrypt. The gains from Conscrypt 2.5.0 are significantly greater than what the workaround provided
    Source code(tar.gz)
    Source code(zip)
  • v1.32.1(Sep 10, 2020)

    API Changes

    • api: Removed deprecated method ChannelBuilder.blockingExecutor() (#7242). There should not be any users as it was deprecated the first release it was available and was renamed offloadExecutor().
    • grpclb: Make ATTR_LB_ADDRS public (#7230). This is necessary to configure grpclb from a custom NameResolver

    New Features

    • xds: perform header matching on concatenated multi-valued headers (#7215)
    • xds: add header matching special cases for hiding/exposing some gRPC headers (#7224). The only gRPC header available for header matching is “content-type”.
    • xds: support load reporting all clusters option and fix actual report interval measurement (#7209). If the LRS response enables send_all_clusters, the client side will report loads for all clusters it is currently using.

    Bug Fixes

    • core, alts, cronet: Fix ByteBuffer covariant method usages (#7349). When built with Java 9+, internal usages of ByteBuffer APIs may cause runtime breakage for dependent applications running with Java 8. This is fixed now.
    • core: Fixed a bug that RPC may hang when hedging is enabled with a throttling configuration (#7337)
    • netty: The environment variable GRPC_EXPERIMENTAL_AUTOFLOWCONTROL=false will now disable the BDP monitoring introduced in v1.30.0. This is intended to help diagnose a “too_many_pings” compatibility issue and will be removed once it is resolved. If you need to use the variable, please file an issue
    • benchmarks: Use correct classpath for scripts (the ones in the bin/ folder of the tar/zip), fixing NoClassDefFoundErrors. The classpath was probably broken starting in v1.30.
    • xds: routing policy should immediately update a picker that selects base on updated config (#7233)

    Dependencies

    • netty: Upgrade to Netty 4.1.51 and tcnative 2.0.31
    • android, cronet: Drop support for android SDK versions older than 16 (#7253). The minimum supported Android SDK version is 16.

    Acknowledgements

    @susinmotion @trustin @wanyingd1996

    Source code(tar.gz)
    Source code(zip)
  • v1.32.0(Sep 10, 2020)

    This release is effectively the same as v1.32.1, but encountered a bug in the release process that prevented publishing binaries. Use v1.32.1 instead.

    Source code(tar.gz)
    Source code(zip)
  • v1.31.1(Aug 12, 2020)

    Bug Fixes

    • netty: The environment variable GRPC_EXPERIMENTAL_AUTOFLOWCONTROL=false will now disable the BDP monitoring introduced in v1.30.0. This is intended to help diagnose a “too_many_pings” compatibility issue and will be removed once it is resolved. If you need to use the variable, please file an issue
    • examples: some gRPC artifacts are missing in JCenter causing Android examples to sometimes fail to build. Now we are adding mavenCentral as fallback for the Android examples. See #5782
    • xds: meshCA protocol buffers added in v1.31.0 are now properly shaded in an internal package
    • xds: fixed some internal breakage for traffic splitting
    Source code(tar.gz)
    Source code(zip)
  • v1.31.0(Jul 30, 2020)

    API Changes

    • api: ManagedChannelBuilder.nameResolverFactory is now marked deprecated. It has long been our plan to remove the function, but was not communicated. Most usages should be able to globally register via the SPI mechanism or NameResolverRegistry.register(). There is a plan to add a method to ManagedChannelBuilder to specify the default target scheme for the channel. If your use-case is not covered, please inform us on #7133

    New Features

    • The following new xDS functionality is added in this release:
      • Requests matching based on path (prefix, full path and safe regex) and headers.
      • Requests routing to multiple clusters based on weights.
      • The xDS features supported in a given release are documented here.
    • api: Added LoadBalancer.Helper.createResolvingOobChannelBuilder(). It is similar to LoadBalancer.Helper.createResolvingOobChannel() except allows configuring the channel (#7136)

    Bug Fixes

    • netty: return status code unavailable when netty channel has unresolved InetSocketAddress (#7023)
    • core: fix a bug that a call may hang when using manual flow control and gRPC retry is enabled (#6817)

    Documentation

    • stub: Documented more behavior of ClientCalls and ServerCalls, with regard to ClientResponseObserver, ClientCallStreamObserver, ServerCallStreamObserver, and exceptions
    • api: Documented how Providers may be used in their respective class documentation. Previously you “just had to know” the SPI mechanism was available

    Dependencies

    • Update guava to 29.0 (#7079)

    Examples

    • examples: Add client/server retrying example via service config #7111

    Acknowledgements

    @alexanderscott @AnarSultanov @cindyxue @d-reidenbach @elharo @gsharma @reggiemcdonald

    Source code(tar.gz)
    Source code(zip)
  • v1.30.2(Jun 22, 2020)

  • v1.30.1(Jun 19, 2020)

    Bug Fixes

    • all: remove grpc-rls from grpc-all dependencies (#7118). grpc-rls is not intended to be published yet, projects depending on grpc-all gets a "failed to collect dependencies at io.grpc:grpc-all:jar:1.30.0 -> io.grpc:grpc-rls:jar:1.30.0" error. This is fixed here.
    • core: fix a bug that a call may hang when using manual flow control and gRPC retry is enabled. (#6817)
    Source code(tar.gz)
    Source code(zip)
  • v1.30.0(Jun 8, 2020)

    Note: gRPC-Java no longer exposes many transitive dependencies as "compile" dependencies, but instead specifies them as "runtime" dependencies. Consuming projects using these dependencies directly will need to explicitly add the dependencies to their compile-time classpath.

    Behavioral Changes

    • netty: Bandwidth delay product (BDP) is enabled by default (#6979). BDP dynamically adjusts flow control window to optimize the network bandwidth utilization. To disable this feature, build channel/server with NettyChannelBuilder#flowControlWindow or NettyServerBuilder#flowControlWindow. Existing flowControlWindow users need to use initialFlowWindowSize to enable BDP. The default initial window size has remained unchanged, so most users should not see a performance difference. In the future we plan to reduce the default size, which may briefly (up to 4 RTT) slow down new connections as they determine an appropriate BDP.

    New Features

    • This release adds an xDS URI scheme called xds. This is the stable version of the scheme xds-experimental that was introduced in v1.28.0. xds-experimental scheme will be removed in subsequent releases so you must switch to xds scheme instead. xds scheme is a client side implementation of xDSv2 APIs. This allows a gRPC client written in Java to receive configuration from an xDSv2 API compatible server and use that configuration to load balance RPCs. In this release, only the virtual host matching, default path (“” or “/”) matching and cluster route action are supported. The features supported in a given release are documented here.
    • core: ManagedChannel provides LoadBalancer#Helper with implemented createResolvingOobChannel (#6923).
    • stub: Add ClientCallStreamObserver.disableAutoRequestWithInitial(int) and ServerCallStreamObserver.disableAutoRequest() that disables all automatic inbound flow-control requests. These methods are intended to replace the existing CallStreamObserver.disableAutoInboundFlowControl(). There may still be some tweaks to the API, so disableAutoInboundFlowControl() is not yet deprecated.
    • inprocess: Add InprocessChannelBuilder.propagateCauseWithStatus(true) to propagate exceptions from the server within status.getCause() (#6968). This is intended for unit tests to ease debugging test failures.
    • netty: support setting options of boss in NettyServer (#6947). Adds a new API on NettyServerBuilder to allow passing channel options for the boss ELG.

    Bug Fixes

    • okhttp: use new APIs to configure TLS in Android (roll forward of #6959) (#6960). Starting from Android 10, there is a new set of public APIs for configuring TLS, where we were previously invoking hidden methods in SSLSocket. Some of those hidden methods are no longer allowed (will be removed in the future) in Android 11. We migrate to use public APIs whenever possible.
    • netty: Using classloader to isolate grpc without isolating netty can cause exceptions when creating netty channel/server is fixed (#7048).
    • api, core, services: make ProtoReflectionService interceptor compatible (#6967). Previously intercepting the ProtoReflectionService breaks the internal hack of passing the server instance to the service. Now we change the way of how it obtains the server instance so that applying interceptors to it doesn’t break its functionality. This change also allows multiple servers to use a shared ProtoReflectionService instance.
    • netty: Reduce race window size between GOAWAY and new streams. This should greatly reduce the number of calls that fail with errors similar to “UNAVAILABLE: HTTP/2 error code: NO_ERROR Received Goaway.” Although note that these errors have multiple sources, and it only addresses one of them
    • core: Delay transport shutdown when changing a subchannel’s addresses. This should prevent users from seeing errors saying “UNAVAILABLE: InternalSubchannel closed transport due to address change,” which should have already been rare

    Documentation

    • For Java 9+ users, we now recommend using org.apache.tomcat:annotations-api for the @Generated annotation instead of javax.annotation:javax.annotation-api, as it has a more appropriate license
    • SECURITY.md: add instruction for disabling Conscrypt's default TrustManager (#6962). By default, Conscrypt delegates hostname verification to the platform's default HostNameVerifier, which in OpenJDK is a deny-all implementation. You can configure the Conscrypt provider to not use its TrustManager.

    Dependencies

    • Starting from this version, some transitive dependencies of gRPC artifacts are changed from compile scope to runtime scope. Users may experience their application can not rebuild once the gRPC version is upgraded, because some other component of the project may require a dependency that is no longer transitively provided by gRPC artifacts at compile time; and if that happens, users should explicitly add that dependency for the other component. This change does not affect running the application at runtime.
    • Bumped protobuf to 3.12.0

    Examples

    • Deleted example-kotlin (#6936). grpc-kotlin was officially released and examples can be found in its own repository.

    Acknowledgements

    @agasparovic-sabre @AgentK20 @apolcyn @asdf2014 @ashithasantosh @chalin @bogdandrutu @DRayX @hojongs @Nextproc @plaflamme @reggiemcdonald @RiyaTyagi

    Source code(tar.gz)
    Source code(zip)
  • v1.29.0(Apr 21, 2020)

    Behavioral Changes

    • core, grpclb: change policy selection strategy for Grpclb policy (move logic of querying SRV into Grpclb's own resolver) (#6723). System property io.grpc.internal.DnsNameResolverProvider.enable_grpclb is eliminated, grpc-grpclb dependency implicitly enables querying SRV records since v1.24.2

    New Features

    • core: ServerInterceptors.useInputStreamMessages() now preserves the KnownLength interface when wrapping InputStream (#6852). This should prevent certain optimizations from being disabled when using useInputStreamMessages
    • core: ServerInterceptors.useInputStreamMessages() and useMarshalledMessages() now preserve the SchemaDescriptor, so the methods are now compatible with the reflection service (#6851)

    Bug Fixes

    • core: Fix IllegalStateException if remote-specified decompressor is unknown (#6864)
    • core: keep round_robin lb subchannel in TRANSIENT_FAILURE until becoming READY (#6657). This avoids RPC being indefinitely queued when subchannels are bouncing back and forth between CONNECTING and TRANSIENT_FAILURE
    • netty: fixed a bug when grpc-netty and grpc-netty-shaded were both used, which could result in "ClassCastException: io.netty.util.AsciiString cannot be cast to io.grpc.netty.shaded.io.netty.util.AsciiString" (#6765)
    • netty: Prevent thread interruption during server start from leaking socket (#6867)
    • core: A Java 9+ ABI compatibility issue with java.nio.ByteBuffer is fixed (#6839). This only impacted users manually compiling grpc-java with JDK 9+ and then using it as a library for applications that run with JDK 8- (e.g., on Android). This does not impact the pre-built JARs on Maven Central
    • core: fixed a bug in health check config propagation. (#6804)
    • benchmarks: some netty benchmarks failed to start and are now fixed (#6877). This was a regression introduced in v1.23.0

    Documentation

    • Add Javadoc for grpc-services and grpc-grpclb to the grpc-all project. This increases the number of classes shown at https://grpc.io/grpc-java/javadoc/
    • examples: Add a JWT authentication example (#5915)

    Dependencies

    • Bump guava to 28.2-android (#6772)
    • Bump netty to 4.1.48.Final, bump tcnative to 2.0.30.Final (#6845)
    • Bump truth version to 1.0.1 (#6754)

    Compiling

    • android: add grpc-android into main build (#6793). Compiling with -PskipAndroid=false (default) includes building grpc-android module, which requires Android SDK

    Acknowledgements

    @chrisschek @elharo Elliotte Rusty Harold @herbyderby Chris Nokleberg @markb74 @ST-DDT

    Source code(tar.gz)
    Source code(zip)
  • v1.28.1(Apr 3, 2020)

    This patch is mainly for the experimental xDS-related features.

    Bug Fixes

    • xds: implement more clear specifications for locality filtering (allow localities with 0 endpoint, ignore localities with 0 weight, check for locality priority continuity). (#6875)
    Source code(tar.gz)
    Source code(zip)
  • v1.28.0(Mar 10, 2020)

    API Changes

    • core: service config parsing now validates the final config object via LoadBalancerProvider#parseLoadBalancingPolicyConfig. LoadBalancer developers should use parsed config(loadBalancingPolicyConfig) in ResolvedAddresses instead of deprecated attribute io.grpc.LoadBalancer.ATTR_LOAD_BALANCING_CONFIG.
    • core: remove stickiness from round robin (#6698)

    Behavioral Changes

    • core, grpclb: change policy selection strategy for Grpclb policy (take one: eliminate special logic for deciding grpclb policy in core) (#6637)
      • gRPCLB policy selection is being stabilized according to this gRFC. gRPCLB policy will not be automatically selected even if there are SRV addresses resolved. You need to explicitly specify the selection by service config (in TXT records, or via ManagedChannelBuilder#defaultServiceConfig or ManagedChannelBuilder#defaultLoadBalancingPolicy).

    New Features

    • This release adds an experimental client side implementation of xDSv2 APIs. This allows a gRPC client written in Java to receive configuration from an xDSv2 API compatible server and use that configuration to load balance RPCs. In this release, only the virtual host matching and cluster route action is supported. More features will be added in future.

    Bug Fixes

    • netty: fix a deadlock on start gRPC server (#6601)
    • netty: negotiated application level protocol is now checked against the correct ALPN list in the SslContext settings
    • okhttp: fix incorrect connection-level flow control handling at beginning of connection (#6742). This only impacted users of OkHttpChannelBuilder.flowControlWindow(), who seem to be few since this bug was not reported sooner
    • alts: Fix using the wrong way of checking if Conscrypt is available (#6672)
    • grpclb: grpclb can handle empty address from LoadBalancer instead of throwing exception
    • alts: do not exclude opencensus-api from google-oauth2's transitive dependencies (#6607)
      • grpc-alts was broken since 1.27.0 release for missing opencensus-api used in google-oauth2. This was due to opencensus-api dependency was eliminated from grpc-core. Now it should be included.

    Documentation

    • stub,examples: Clarify CallStreamObserver's Javadoc (#6561)

    Dependencies

    • Bump Netty to 4.1.45.Final and tcnative to 2.0.28.Final
    • Bump okhttp to 2.7.4
    • Bump google-auth-library-credentials and google-auth-library-oauth2-http to 0.20.0

    Acknowledgements

    @chrisschek @cushon Liam Miller-Cushon @elharo Elliotte Rusty Harold @gfelbing Georg Welzel @hatahet Ziad Hatahet @leventov Roman Leventov @sourabhsparkala Sourabh Sarvotham Parkala @ZhenLian Zhen Lian

    Source code(tar.gz)
    Source code(zip)
  • v1.27.2(Feb 25, 2020)

  • v1.27.1(Feb 13, 2020)

  • v1.26.1(Feb 13, 2020)

    Bug Fixes

    • bazel: Use https to download from Maven Central (#6543)
    • bazel: Fix renamed javalite target that caused build failures in 1.26.0 (#6544)
    • alts: Fix using the wrong way of checking if Conscrypt is available (#6672)
    Source code(tar.gz)
    Source code(zip)
  • v1.27.0(Feb 4, 2020)

    Bazel users should migrate to maven_install. Please open an issue to report problems migrating to maven_install.

    Dependencies

    • core, census: census dependency is removed from grpc-core. A grpc-census artifact now exists to provide interceptor/stream tracer factory that applies census stats/tracing features. For users not using gRPC’s integration of census, nothing should be affected. Users who want census integration need to add grpc-census artifact to runtime classpath (#6577)
    • Bump animal-sniffer-annotations to 1.18 (#6488)
    • Bump error_prone_annotations to 2.3.4 (#6574)
    • auth: Bump google-auth-library-credentials and google-auth-library-oauth2-http to 0.19.0 (#6537)
    • protobuf: Bump proto-google-common-protos to 1.17.0 (#6572)

    Bug Fixes

    • netty: the warning “Received GOAWAY with ENHANCE_YOUR_CALM. Debug data:” will now actually contain the debug data (#6596)
    • examples: example servers now shutdown gracefully (#6512)
    • api: update documentation to encourage libraries to provide scheme in target string during channel creation (#6499)
    • bazel: Use https to download from Maven Central (#6543)
    • bazel: Fix renamed javalite target that caused build failures in 1.26.0 (#6544)

    API Changes

    • bazel: Remove omit* args in favor of existing_rule() check (#6553). If you are passing any arguments to grpc_java_repositories() within your WORKSPACE, you will need to remove those arguments and make sure you run grpc_java_repositories() after defining any overridden repositories
    • bazel: Support maven_install (#6553). See examples/WORKSPACE for typical usage. grpc-java still supports the jvm_maven_import_external()-based loading only to ease migration. grpc-java will drop usages of jvm_maven_import_external() in the future

    New Features

    • core: delay sending cancel request on client-side by one second when deadline expires (#6328). This only impacts metrics reported by the server. It provides the server a second to internally fail the call with DEADLINE_EXCEEDED instead of CANCELLED which should substantially improve the accuracy of the metrics
    • grpclb: support explicit fallback from LB (#6549)
    • netty: set -Dio.grpc.netty.useCustomAllocator=true by default (#6528). This causes grpc to use a different Netty allocator by default which is configured to allocate in smaller chunks which may reduce memory usage by 8x on lightly loaded systems. Performance benchmarks show virtually no change with any potential slowdowns hidden in the noise (~1%). See also #6407. If you notice problems, set the property to false and file an issue
    • api: support for lazily serialized values in Metadata (#6466). Metadata marshallers must opt-in to being serialized lazily. Nothing is using this support at the moment (including protobufs). This can be used for avoiding serialization with in-process transport or for transport-specific features like file descriptor passing in metadata (such things were already possible with RPC messages).
    • alts: add AuthorizationUtil utility library for verifying a client is a particular account (#6529)
    • examples: hostname example added. This is intended as a test server for use when testing load balancers. It is also available on Docker Hub

    Known issues

    • netty: listening on multiple ports (via NettyServerBuilder.addListenAddress()) may deadlock (bug #6641). This has been the case since its introduction

    Acknowledgements

    • Aleksei Kandybaev (@akandybaev)
    • Dounan Shi (@dounan)
    • Elliotte Rusty Harold (@elharo)
    • Graeme Morgan (@graememorgan)
    • Jiangtao Li (@jiangtaoli2016)
    • @markb74
    • Nathan H. Leung (@nathanhleung)
    • @ST-DDT
    • Tomo Suzuki (@suztomo)
    • @ZhenLian
    Source code(tar.gz)
    Source code(zip)
  • v1.26.0(Dec 18, 2019)

    Dependencies

    • Bump protobuf-java to 3.11.0.
    • Bump protobuf-javalite to 3.11.0. This brings lite in-line with full protobuf. Be aware that the Maven artifact name changed for Protobuf lite. The dependency is now com.google.protobuf:protobuf-javalite instead of com.google.protobuf:protobuf-lite
    • Bump gson to 2.8.6
    • Bump google-auth-library-credentials and google-auth-library-oauth2-http to 0.18.0 (#6360)
    • Bump mockito to 2.28.2 (#6355)

    Bug Fixes

    • netty, okhttp: Known IOExceptions are logged as FINE level
    • interop-testing, benchmarks: missing executables (since 1.19.0) is now published again
    • cronet: grpc-cronet artifact contains empty .aar due to code shrinking was enabled, now it is fixed.
    • alts: fix lazychannel close (#6475)

    API Changes

    • api, core: make channel logger accessible through NameResolver.Args (#6430)
    • api, core: make scheduled executor service accessible for NameResolver.Args (#6455)
    • stub, compiler: generated stubs are now extended from AbstractStub to indicate stub type (AbstractAsyncStub, AbstractFutureStub, AbstractFutureStub)
    • api: the deprecated API ManagedChannelBuilder.usePlaintext(boolean) is removed (#1772, #6440).

    New Features

    • Pre-build binaries for the aarch64 platform
    • Add s390x cross-compiling support

    Acknowledgements

    • Carl Mastrangelo (@carl-mastrangelo)
    • Elliotte Rusty Harold (@elharo)
    • Liu sheng (@liusheng)
    • Nayana Thorat (@nayana-ibm)
    • Steve Rao (@steverao)
    • Tomo Suzuki (@suztomo)
    • Yongwoo Noh (@yonguno)
    Source code(tar.gz)
    Source code(zip)
  • v1.24.2(Nov 6, 2019)

    Dependencies

    • Bumped perfmark to 0.19.0
    • Bumped error_prone_annotations to 2.3.3

    Bug Fixes

    • alts: fixed wrong ComputeEngineChannelBuilder class signature (#6381)

    New Features

    • grpclb: Add dns NameResolver to io.grpc.grpclb that has SRV record lookup enabled by default (#6298). This allows using grpclb without the -Dio.grpc.internal.DnsNameResolverProvider.enable_grpclb=true system property. Note that grpclb is still experimental and deprecated. In particular, we plan to change grpclb policy selection which together with this change provides a path forward for grpclb to function without custom support in grpc-core; see gRFC A26
    Source code(tar.gz)
    Source code(zip)
  • v1.25.0(Nov 6, 2019)

    Dependencies

    • Bumped netty to 4.1.42
    • Bumped error_prone_annotations to 2.3.3
    • Bumped perfmark to 0.19.0
    • Bumped guava to 28.1
    • Bumped gson to 2.8.5
    • Bumped protobuf to 3.10.0
    • Tests bumped truth to 1.0

    Bug Fixes

    • Rolled forward the fix for “ClientCall.Listener.onClose never called when the call is interrupted” (#6255)
    • netty: fixed the bug that users using proxy may experience hang when starting channel (#6159)
    • alts: fixed potential memory leak when alts negotiation is aborted (#6186)
    • alts: fixed wrong ComputeEngineChannelBuilder class signature (#6367)
    • bom: now specifying pom type for protoc-gen-grpc-java (#6247)
    • netty: Check for TE: trailers header after checking Content-Type. This prevents confusing warnings when a non-grpc client contacts a grpc server
    • bazel: Fixed typo in repositories.bzl for maven_install override_targets; io.grpc:grpc-core was pointing to a non-existent target name
    • okhttp: fixed header scheme that did not match transport type (#6264). OkHttp users using plaintext may experience errors when communicating with dotnet gRPC server is fixed.

    API Changes

    • api: MethodDescriptor’s safe and idempotent methods are now considered stable and set appropriately by the generated code when the proto contains the RPC option option idempotency_level = NO_SIDE_EFFECTS; or option idempotency_level = IDEMPOTENT;. grpc-java is not using these values directly, but interceptors are free to observe them
    • protobuf: StatusProto.fromStatusAndTrailers fall-back to status if trailers are not available (#6278). Previously it returned null
    • bazel: Removed deps from grpc_java_repositories() that protobuf_deps() provides
    • ManageChannelBuilder.usePlaintext() (with no argument) is now stabilized.

    New Features

    • okhttp: add full implementation of HPACK header compression (#6026). Patched HTTP header compression implementation for writer from OkHttp3, which was missing in OkHttp2.
    • bazel: added support for --incompatible_load_cc_rules_from_bzl and --incompatible_load_proto_rules_from_bzl
    • netty: Implicitly use Conscrypt when it is available and is necessary. If tcnative is not available and the JVM is Java 7 or 8, then grpc will use Conscrypt if present. This allows using Conscrypt by just adding Conscrypt to the classpath
    • alts: Use Conscrypt when available. This provides Java 7 support and gives a huge performance boost on Java 8. Java 7 update 121 and Java 8 update 111 (released three years ago) are required.
    • api: Add EquivalentAddressGroup.ATTR_AUTHORITY_OVERRIDE which allows NameResolvers to specify different names for different backends within one Channel which may be especially useful for certain TLS deployments (#6126). Note that NameResolvers must receive the authority names from a trusted source (e.g., local file, remote server with TLS)
    • core: Propagate EquivalentAddressGroup Attributes in RoundRobinLoadBalancer. This allows NameResolvers to set attributes like ATTR_AUTHORITY_OVERRIDE with round robin
    • api: Added ManagedChannelBuilder.offloadExecutor() for expensive or blocking operations like DNS resolution. Previously an internal executor was used that couldn’t be overridden. The executor is also passed to NameResolvers via Args.getOffloadExecutor()
    • grpclb: Add dns NameResolver to io.grpc.grpclb that has SRV record lookup enabled by default (#6298). This allows using grpclb without the -Dio.grpc.internal.DnsNameResolverProvider.enable_grpclb=true system property. Note that grpclb is still experimental and deprecated. In particular, we plan to change grpclb policy selection which together with this change provides a path forward for grpclb to function without custom support in grpc-core; see gRFC A26

    Acknowledgements

    • Anar Sultanov (@AnarSultanov)
    • Elliotte Rusty Harold (@elharo)
    • Grant Oakley (@groakley)
    • Przemek Piotrowski (@ppiotrow)
    • Steve Rao (@steverao)
    • edr (@enguerrand)
    Source code(tar.gz)
    Source code(zip)
  • v1.24.1(Oct 25, 2019)

    This release resolves proxy hang issue during initial protocol negotiation, users using proxy should upgrade. ADDED: please upgrade to 1.24.2 or 1.25.0, see known issues for more details.

    Known Issues

    • grpclb change described in new features is not part of this release, users should upgrade to 1.24.2 or 1.25.0.
    • Users may see dependency failing error about error_prone_annotations version requirement when building the application (#6217). Adding perkmark 0.19.0 (io.perfmark:perfmark-api:0.19.0) to dependency can workaround this issue.

    Dependencies

    • ~Bump perfmark to 0.19.0~ correction: didn't made the cut

    Bug Fixes

    • netty: Users using proxy may experience hang is fixed (#6159).
    • bom: specify pom type for protoc-gen-grpc-java (#6247).
    • okhttp: fix header scheme does not match transport type (#6264). OkHttp users using plaintext may experienced error when communicate with dotnet gRPC server is fixed.

    New Features

    • ~grpclb: Add dns NameResolver to io.grpc.grpclb that has SRV record lookup enabled by default (#6298). This allows using grpclb without the -Dio.grpc.internal.DnsNameResolverProvider.enable_grpclb=true system property. Note that grpclb is still experimental and deprecated. In particular, we plan to change grpclb policy selection which together with this change provides a path forward for grpclb to function without custom support in grpc-core; see gRFC A26~ correction: didn't made the cut, please use 1.25.0 or 1.24.2.
    Source code(tar.gz)
    Source code(zip)
Owner
grpc
A high performance, open source, general-purpose RPC framework
grpc
Reactive stubs for gRPC

What is reactive-grpc? Reactive gRPC is a suite of libraries for using gRPC with Reactive Streams programming libraries. Using a protocol buffers comp

Salesforce 599 Mar 9, 2021
LINE 3k Mar 12, 2021
Book Finder application is a client-server application (gRPC) for educational purposes.

Book-Finder Book Finder application is a client-server application (gRPC) for educational purposes. Instalation These projects (Client/Server) are Mav

Mihai-Lucian Rîtan 20 Apr 5, 2021
Apache Dubbo is a high-performance, java based, open source RPC framework.

Apache Dubbo Project Apache Dubbo is a high-performance, Java-based open-source RPC framework. Please visit official site for quick start and document

The Apache Software Foundation 34.8k Mar 13, 2021
A Java library that implements a ByteChannel interface over SSLEngine, enabling easy-to-use (socket-like) TLS for Java applications.

TLS Channel TLS Channel is a library that implements a ByteChannel interface over a TLS (Transport Layer Security) connection. It delegates all crypto

Mariano Barrios 113 Mar 1, 2021
A networking framework that evolves with your application

ServiceTalk ServiceTalk is a JVM network application framework with APIs tailored to specific protocols (e.g. HTTP/1.x, HTTP/2.x, etc…) and supports m

Apple 656 Mar 13, 2021
Java API over Accelio

JXIO JXIO is Java API over AccelIO (C library). AccelIO (http://www.accelio.org/) is a high-performance asynchronous reliable messaging and RPC librar

Accelio 71 Jan 5, 2021
Unconventional I/O library for Java

one-nio one-nio is a library for building high performance Java servers. It features OS capabilities and JDK internal APIs essential for making your h

OK.ru 466 Mar 11, 2021
A Linux packet crafting tool.

Pig Pig (which can be understood as Packet intruder generator) is a Linux packet crafting tool. You can use Pig to test your IDS/IPS among other stuff

Rafael Santiago 383 Mar 11, 2021
Square’s meticulous HTTP client for the JVM, Android, and GraalVM.

OkHttp See the project website for documentation and APIs. HTTP is the way modern applications network. It’s how we exchange data & media. Doing HTTP

Square 39.6k Mar 13, 2021
Socket.IO server implemented on Java. Realtime java framework

Netty-socketio Overview This project is an open-source Java implementation of Socket.IO server. Based on Netty server framework. Checkout Demo project

Nikita Koksharov 5.2k Mar 14, 2021
Fibers and actors for web development

COMSAT Scalable, Concurrent Web Apps Getting started Add the following Maven/Gradle dependencies: Feature Artifact Servlet integration for defining fi

Parallel Universe 586 Feb 23, 2021
Asynchronous Http and WebSocket Client library for Java

Async Http Client Follow @AsyncHttpClient on Twitter. The AsyncHttpClient (AHC) library allows Java applications to easily execute HTTP requests and a

AsyncHttpClient 5.7k Apr 23, 2021
ssh, scp and sftp for java

sshj - SSHv2 library for Java To get started, have a look at one of the examples. Hopefully you will find the API pleasant to work with :) Getting SSH

Jeroen van Erp 1.8k Mar 12, 2021