Skip to content

Releases: grpc/grpc-java

v1.30.1

19 Jun 20:49
Compare
Choose a tag to compare

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)

v1.30.0

08 Jun 22:45
Compare
Choose a tag to compare

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

v1.29.0

22 Apr 02:51
Compare
Choose a tag to compare

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

v1.28.1

03 Apr 19:29
Compare
Choose a tag to compare

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)

v1.28.0

10 Mar 21:54
Compare
Choose a tag to compare

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

v1.27.2

26 Feb 02:19
Compare
Choose a tag to compare

Bug Fixes

  • grpclb: grpclb can handle empty address from LoadBalancer instead of throwing exception

v1.27.1

14 Feb 01:01
Compare
Choose a tag to compare

Bug Fixes

  • alts: Fix using the wrong way of checking if Conscrypt is available (#6672)

v1.26.1

13 Feb 18:12
Compare
Choose a tag to compare

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)

v1.27.0

04 Feb 21:26
Compare
Choose a tag to compare

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

v1.26.0

18 Dec 23:37
Compare
Choose a tag to compare

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