Skip to content

Releases: grpc/grpc-java

v1.22.0

02 Jul 21:21
Compare
Choose a tag to compare

Dependencies

  • upgrade netty version to 4.1.35 and netty-tcnative version to 2.0.25 (#5818)

Bug Fixes

  • core: fixed #5692: NameResolver refresh not triggered if empty addresses returned
  • services: fix HealthCheckingLoadBalancer.shutdown() (#5887)
  • bazel: fixed a regression in v1.21 where java_grpc_library ignored custom java toolchains (#5844)
  • ALTS connection setup and teardown is more stable, less noisy.
  • netty: some of the less interesting transport level exceptions are now fine level (#5873)
  • testing: resource leak is fixed for TestUtils#newSslSocketFactoryForCa

API Changes

  • protobuf-nano was deleted. The Protobuf project dropped support for nano in favor of javalite, which was causing trouble for gRPC’s development. Users of nano can continue using older grpc-protobuf-nano releases, as it only uses stable API. See gRFC L51.
  • LoadBalancer API sees a few changes that will help hierarchical implementations:
    • api: LoadBalancer.Helper and Subchannel is now further non-thread-safe. (#5718)
    • api: move SubchannelPicker.requestConnection() to LoadBalancer. (#5751)
    • api: pass Subchannel state updates to SubchannelStateListener rather than LoadBalancer (#5722). Different from the old LoadBalancer#handleSubchannelState(), the new SubchannelStateListener continues to receive updates after LoadBalancer is shutdown. (#5883)
    • api: Subchannel.requestConnection() will print a warning if called outside of sync-context (#5757). We plan to make it throw eventually.
    • api: deprecate Helper.updateSubchannelAddresses() and add equivalent on Subchannel (#5802)
  • netty,okhttp: The experimental and long-deprecated enableKeepAlive API was removed from the transport channel builders (#5795). Setting the keep alive settings individually is still available and is stable API. The removed API was actively causing user issues because its defaults were too aggressive for the server’s defaults.
  • api: new method for removing values from Attributes.
  • core: some of the open census tags (method, status tags) are no longer propagated. This may break users who depends on the behavior that these tags propagate through process boundaries. (#5689)

New Features

  • api: add getters for NameResolver.Args and NameResolverRegistry in LoadBalancer.Helper (#5685) (We are considering deleting getNameResolverRegistry() in the near future. Please reach out to us if you want to keep it).
  • netty: can log the stages of connecting (client side only), such as TLS.
  • Added perfmark annotations to RPCs for local tracing.

Documentation

  • examples: use test certs for running example-tls (#5763)
  • SECURITY.md: Add Fedora 30 package installation instructions (#5734)
  • api,stub: Clarify isReady()/onReady() interaction semantics (#5799)
  • examples: TLS examples are easier to run(#5715)

Acknowledgements

v1.21.0

23 May 19:29
Compare
Choose a tag to compare

Dependencies

  • context: Removed unnecessary deps from Bazel target. gRPC depends on these deps elsewhere, so it only benefits Bazel users using context by itself
  • core: Upgraded to OpenCensus 0.21.0 (#5657)
  • services: Removed dependency on re2j. Re2j is no longer used by grpc

Bug Fixes

  • stub: release server-streaming reference on request after method call (#5638). This allows the request to be garbage collected much sooner for a long-lived RPC
  • netty: ALPN negotiation failure is now properly reported as UNAVAILABLE, not UNKNOWN
  • okhttp: Deadlock during transport start when network became unavailable during the start up is fixed (#5567)

API Changes

  • api: The classes in io.grpc (not subpackages) were moved to a new artifact “grpc-api”, from grpc-core (#5590). This allows using the API without bringing in as many dependencies, and makes it easier for libraries to have an optional dependency on the rest of grpc. grpc-core now depends on grpc-api. Many users should be able to depend on grpc-api instead of grpc-core if they wish. grpc-core still contains the in-process transport, io.grpc.util, and internal classes used elsewhere in grpc. Most users should still expect to have at least a transitive dependency on grpc-core.
  • api: Stabilized MethodDescriptor.Marshaller
  • api: Added NameResolverRegistry (#5586). It is now possible to construct a NameResolverProvider and register it into the global map manually. This is useful to inject dependencies into the name resolver.
  • api: add a convenience getService() method on MethodDescriptor (#5633)
  • api: added a new LoadBalancer.handleResolvedAddresses() API for handling resolved addresses which includes service config explicitly (#5499). LoadBalancer.handleResolvedAddressGroups() is deprecated
  • api: introduced NameResolver.Args that deprecates NameResolver.Helper. (#5664)
  • api: make LoadBalancer.Helper and Subchannel further non-thread-safe (#5718)
  • api: augment LoadBalancer.CreateSubchannelArgs with custom options (#5640)
  • api: deleted ManagedChannelBuilder.loadBalancerFactory() and all deprecated factories (#5480). Use LoadBalancerRegistry and ManagedChannelBuilder.defaultLoadBalancingPolicy() instead
  • api: changed ClientStreamTracer.StreamInfo to a final class with a builder (#5648)
  • core/util: create a ForwardingClientStreamTracer class for delegation use (#5589)
  • netty: Netty server sets default socket options for all socket-based transports. Not just NIO

New Features

  • stub: optimized CPU and memory usage of the internal ThreadlessExecutor used for blocking calls (#5516)
  • stub: Improved error message on client and server when StreamObserver.onNext() is called after onCompleted() (#5656)
  • netty: Netty channel / server will now default to using Netty’s Epoll transport when able, otherwise uses Nio like before. To use epoll, it requires to have a runtime dependency netty-transport-native-epoll and epoll supported OS (linux) (#5581)
  • netty: now defers to netty for the default number of event loops, if unspecified (#5585). This should only matter when using system properties to override Netty’s defaults
  • netty: TCP_USER_TIMEOUT is now enabled and set to the keepalive timeout if keepalive is enabled and if using the netty epoll transport (#5599). This can reduce the failure detection delay without a network cost
  • okhttp: add verbose logging for OkHttp HTTP/2 frame content (#5488)
  • auth: MoreCallCredentials now uses Credentials Builder instead of deprecated constructor to create the ServiceAccountJwtAccessCredentials used internally. This means JWT will continue to be used when the constructor is removed. Before this change the code would fall back to exchanging OAuth tokens if the constructor was not available
  • examples/android: add example for grpc running under StrictMode (#5527)

Documentation

  • api: add note about retrying UNAVAILABLE for non-idempotent RPCs in Status documentation (#5595)

Acknowledgements

Thanks to all of our contributors:

v1.20.0

10 Apr 21:23
Compare
Choose a tag to compare

Dependencies and Build Changes

  • Upgraded to Netty 4.1.34 and Netty TCNative 2.0.22
  • Upgraded to Protobuf 3.7.1
  • Test code upgraded to Mockito 2 (fixes #5319)
  • io.grpc:grpc-testing no longer (transitively) depends on mockito
  • Bazel 0.23 or newer is required. This was required to support --incompatible_use_toolchain_providers_in_java_common . As of Bazel 0.24, grpc is compatible with all incompatible flags marked for migration
  • auth: Upgraded google-auth-library-java to 0.13.0
  • bazel: grpc_java_repositories: fix com_google_protobuf_javalite sha256. (#5456)

Bug Fixes

  • core: suppress android lint error for javax.naming.*
  • bom: added missing artifact (protoc-gen-grpc-java) to bom, removed grpc-compiler.
  • services/grpclb: use Stopwatch to count for LB backoff time.
  • core: fixed an issue that DNS JNDI does not work if there is an unavailability cause (#5500)
  • netty: fixed a memory leak due to the default grace time (#5443)
  • core: make the newNameResolver() change backward compatible for callers (#5564, fixes #5556)
  • okhttp: fixed a deadlock (#5570)
  • core: corrected config key for hedging max attempts (#5373)
  • grpclb: keep track of state updates for cached Subchannels. (#5441)

New Features

  • bazel: created bazel targets for grpc-services (#5384)
  • ALTS: added ComputeEngineChannelBuilder (#5473)
  • okhttp: add socketFactory method to channel builder (#5378)
  • grpclb: now supports "pick_first" child policy in addition to the default "round_robin" (#5438)

Behavior Changes

  • grpclb: use fallback addresses if no balancer address is given (#5445)

API Changes

  • core: Deprecated ClientStreamTracer.Factory#newClientStreamTracer is now deleted(#5377)
  • core: NameResolver no longer needs to be thread-safe (#5364)
  • core: Added ManagedChannelBuilder.defaulServiceConfig() and disableServiceConfigLookUp()
  • core: deprecated LoadBalancer.Helper#getNameResolverFactory (#5418)

Documentation

  • COMPILING.md: updated document for codegen plugin compilation instruction.
  • SECURITY.md: document that tcnative/ALPN works on Alpine. It is unclear how long Alpine has been capable of working
  • examples: add an example of server-side compression support (#5358)

Acknowledgments

Thanks to all of our contributors:

v1.19.0

28 Feb 18:56
Compare
Choose a tag to compare

Dependencies and Build Changes

  • Upgraded to protobuf 3.6.1 (#5320)
  • Google App Engine Java 7 is no longer supported, as it was shut down. Java 8 is supported.
  • Upgraded Guava to 26.0-android
  • Add "fake" Bazel dependency on Guava's failureaccess to fix dependency handling issue in maven_jar (#5350)
  • Upgraded OpenCensus to v0.19.2 (#5329)

Bug Fixes

  • Fixed Service Config DNS parsing to match specification (Service Config is still off by default) (#5293)
  • OkHttp no longer spams NPE when connecting to a server that's down (#5260)
  • Context avoids leaking ClassLoader through a ThreadLocal (#5290)
  • Status is now preserved when getting a RST_STREAM with no error (#5264)
  • Removed Channel reference from ManagedChannelWrapper to avoid a memory leak (#5283)
  • Avoid NPE in Cronet after the transport has shutdown (#5275)
  • Fixed a channel panic caused by calling NameResolver.refresh() (#5223)

New Features

  • New artifact grpc-bom is added (#5209)
  • Each ManagedChannel can now have its own ProxyDetector (#5173)

Behavior Changes

  • If enabled, health checking defaults to SERVING if the name unspecified (#5274)
  • Graceful Netty server shutdown now issues two GOAWAYs (#5351)
  • Client-side health checking now warns if disabled (#5261)

API Changes

  • Removed DEFAULT_CONNECTION_SPEC from OkHttpChannelBuilder (#5309)
  • NettyChannelBuilder now accepts a channelFactory (#5312)
  • NettyServerBuilder supports listening on multiple sockets (#5306)
  • CallCredentials is now preferred over CallCredentials2 (#5216)
  • ProxiedSocketAddress is added as an Experimental API (#5344)
  • Added NameResolver.Helper, for use with new NameResolver.newNameResolver() overload (#5345)
  • Deprecated previous NameResolver.newNameResolver() overload (#5345)

Documentation

Acknowledgments

Thanks to all of our contributors:

v1.18.0

15 Jan 19:30
Compare
Choose a tag to compare

Dependencies

  • Downgraded to Guava 25.1 to ease gRPC upgrade for users of Beta APIs broken in Guava 26. We’re planning to upgrade in gRPC-java v1.19.0
  • Upgraded to Netty 4.1.32 and Netty TCNative 2.0.20
  • Upgraded to OpenCensus 1.18.0

Bug Fixes

  • core: Fixed typo in deprecation warning in RoundRobinLoadBalancerFactory (#5117). The balancer has the name round_robin in the registry (not round-robin)
  • core: Fixed a bug where CallOptions#withOption() mutates original instance if existing key is overwritten (#5142)
  • stub: on server-side, disable cancellation exception from StreamObserver.onNext if onCancelHandler set (#5061). When using onCancelHandler, this makes it so that grpc’s implementations of StreamObserver.onNext never throw a StatusRuntimeException
  • stub: make sure StreamObservers.copyWithFlowControl() only calls onComplete once (#4558)
  • okhttp: Fixed Android out of memory upon network disconnect (#4860). Applications sending many small messages on a single stream may see much lower memory use
  • bazel: Corrected re2j SHA in repositories.bzl
  • bazel: Use new http_archive rule instead of the deprecated native.http_archive (#5104)
  • alts: Fixed inactivity-triggered shutdown of netty event loop causing future Channels to enter panic mode

New Features

  • Deadlines have a more readable toString() representation
  • core: User can now register custom LoadBalancerProviders into LoadBalancerRegistry (#5070)
  • core: ManagedChannelBuilder can now specify the default load-balancing policy by name (#5135)
  • core: Added hedging support specified by the retry spec. Calling ManagedChannelBuilder.enableRetry() will enable ordinary retry as well as hedging. Caveat: Retry/hedging need to consume a service config with retry/hedging policies, but currently grpc-java library did not provide an effective way/API to produce a service config locally or from name resolver yet
  • core: LoadBalancer can now trigger name resolution refresh (#5121)
  • core: the new LoadBalancingConfig field from Service Config is now supported (#5073)
  • core: LoadBalancer can opt-in to receive empty address list from NameResolver (#5148)
  • core: ClientStreamTracer can intercept trailing metadata (#5088)
  • core: Record real-time metrics (reported on a per-message basis) to OpenCensus (#5099)
  • netty: Fixed client-side support for h2c via Upgrade (#4518). This is still a second-class negotiation mechanism as it lacks good tests and is rarely used

API Changes

  • HealthStatusManager can go permanently unhealthy to aid in server shutdown

Documentation

  • examples: Added JWT authentication and Google Cloud Authentication examples

Acknowledgements

Thanks to all our external contributors:

Arnout Engelen @raboof
Brendan Linn @Ubehebe
David Hoover @deadmoose
Grant Oakley @groakley
Rodrigo Queiro @drigz
ST-DDT @ST-DDT
Thomas Broyer @tbroyer
Venil Noronha @venilnoronha
Ze'ev Klapow @zklapow

v1.17.2

18 Dec 17:35
Compare
Choose a tag to compare

This release is only available as a GitHub tag, no artifacts are shipped to the Maven central repository. If you do not build your project with Bazel, you should still choose v1.17.1.

Bug Fixes

  • Removed usage of the deprecated native.http_archive rule that does not work with Bazel 0.20.0 (#5156)

v1.17.1

10 Dec 18:31
Compare
Choose a tag to compare

Bug Fixes

  • Bazel users should no longer see “java.util.ServiceConfigurationError: io.grpc.LoadBalancerProvider: Provider io.grpc.util.SecretRoundRobinLoadBalancerProvider$Provider not found”. The workaround for 1.17.0 to add a dependency on @io_grpc_grpc_java//core:util is no longer necessary (#5114)

Behavior Changes

  • core: SRV records are no longer queried by default when doing DNS lookups. This restores the 1.16.x behavior. This avoids a bug which would in the future make it hard for existing services to enable gRPC LB (#5131)

v1.17.0

06 Dec 00:05
Compare
Choose a tag to compare

Do not use this release. Its handling of gRPCLB causes problems for the ecosystem

Known Issues

Dependencies

  • Updated to OpenCensus version to 0.17.0
  • Updated to Error Prone to 2.3.2

Bug Fixes

  • Bazel build warning "unknown enum constant" is fixed (#5047)
  • core: Add missing synchronization in KeepAliveManager which fixes a crash caused by a race (#5096). This fixes the “IllegalStateException: There should be no outstanding pingFuture” exception

New Features

  • core: added service-loader-based LoadBalancerProvider/LoadBalancerRegistry. Providers are to be accessed by policy name through the registry. (#4996)
  • core: LoadBalancer now exposes ChannelLogger for logging information into ChannelTrace (#5024)
  • core: Add maxInboundMetadataSize() to ManagedChannelBuilder and ServerBuilder (#4897). It is now also implemented by the inprocess and okhttp transports
  • okhttp: flow control window size is configurable via OkHttpChannelBuilder.flowControlWindow() (#4959)
  • services: implemented the stream-based “Watch” method of health-checking service (#4930)
  • services: implemented client-side health-checking (https://github.com/grpc/proposal/blob/master/A17-client-side-health-checking.md). This issues health check RPCs from the client to avoid unhealthy backends
    • HealthCheckingLoadBalancerUtil can be used to enable health-checking on custom LoadBalancer implementations.
    • The “round_robin” balancer, when accessed through LoadBalancerRegistry, will have health-checking enabled if the application has a runtime dependency on “grpc-services”.

API Changes

  • core: Change CallCredentials.MetadataApplier from an abstract class back to an interface, as it was in 1.15.x. Introduce a new CallCredentials2.MetadataApplier that is an abstract class, instead. This is ABI incompatible with 1.16.0 but ABI compatible with 1.15.x and 1.16.1 (#5007)
  • core: LoadBalancer.Helper.runSerialized() is deprecated in favor of newly introduced getSerializationContext().
  • core/grpclb: deprecated all stock LoadBalancerFactory implementations in favor of service-loader-based LoadBalancerProvider/LoadBalancerRegistry. Instead of referencing RoundRobinLoadBalancerFactory and GrpclbLoadBalancerFactory directly, applications should access providers by their policy names, such as “round_robin” and “grpclb”.(#4996).
  • core: mark convenience overloads in LoadBalancer.Helper and Subchannel as final, as there is no purpose in overriding them. (#4954)
  • core: Improved documentation of ManagedChannelBuilder.intercept's execution order
  • netty: NettyChannelBuilder.maxMessageSize() is removed in favor of maxInboundMessageSize() (#5054)

API Stabilization

  • services: V1alpha binlog is removed in favor of v1 (#4963)

Behavior Changes

  • core: Enabling retry will automatically disable census. Note that this behavior is still subject to change in future releases as a design is needed. (#4941) Comments are welcome
  • core: SRV records are now queried by default when doing DNS lookups. SRV lookups are avoided for localhost and literal IP addresses. SRV is not looked up when running on Android
  • core: Trim trailing dot from SRV hostnames (#5006)
  • all: Now grpc java library emits binary metadata without padding in its base64 encoding (previously with padding). grpc library still supports receiving both padded and unpadded binary metadata (#5037)
  • okhttp: Pending data uses less memory by merging buffers (#5023). This can save memory when the server is applying flow control and many small messages are being sent on a streaming RPC
  • core: Improved error message for Auto-LB configuration failure (#5031). Previously it triggered a NullPointerException
  • okhttp: “error in frame handler” error is now INTERNAL instead of UNAVAILABLE (#5049)
  • core,netty,testing: supports receiving comma-separated multi-valued binary metadata (#5020)
  • core: Name resolver error message now includes type of name resolver (#4928)
  • core: When SRV lookup is disabled, DNS resolution now fails with helpful error message instead of “UNAVAILABLE: NameResolver returned an empty list” (#4951)
  • core: For android devices, DNS cache is disabled due to known issue (#4962). The DNS cache is mainly used for SRV lookup results, which aren’t performed on Android
  • Netty: NettyServer log quietly when established connection was aborted by the software in your host machine (#5001)

Acknowledgements

Thanks to all our external contributors:

v1.16.1

26 Oct 22:02
Compare
Choose a tag to compare

API Changes

  • Change CallCredentials.MetadataApplier from an abstract class back to an interface, as it was in 1.15.x. Introduce a new CallCredentials2.MetadataApplier that is an abstract class, instead. This is ABI incompatible with 1.16.0 but ABI compatible with 1.15.x (#5007)

v1.16.0

26 Oct 21:04
Compare
Choose a tag to compare

Important notice

This version had an inadvertent ABI breakage in the @ExperimentalApi CallCredentials. Please use v1.16.1 instead.

Dependencies

  • Updated to Guava 26.0-android and jsr305 3.0.2
  • Updated to Netty 4.1.30 and Netty tcnative 2.0.17

Bug Fixes

  • core: DnsNameResolver cache for SRV records (as seen in 1.15.1) is reverted due to issues on Android devices, even when SRV lookup was disabled (#4988)
  • grpc-core and grpc-okhttp now use Java 7 bytecode instead of Java 6 bytecode. If this causes you issue, please file an issue
  • core: Propagate UnknownHostException when DNS fails instead of ignoring the failure. This improves the error message from “UNAVAILABLE: NameResolver returned an empty list”
  • okhttp: settings acks back after apply settings before sending any data. Fixes #4809. If you are seeing "INTERNAL: Flow control error\nRst Stream", then you were likely impacted
  • cronet: Correctly notify ClientStreamTracer.outboundHeaders() (#4768)
  • services: binary log config strings cause throw an error if ambiguous (#4868)
  • core: fixed NPE when getAuthority() is called on a channel that has shut down (#4886)

New Features

  • core: Attributes getters and Keys now have annotations to make them easier to discover. See the Attributes documentation for more information (#4892)
  • core: Added Grpc.TRANSPORT_ATTR_LOCAL_ADDR for accessing the connection’s local address via ClientCall/ServerCall.getAttributes() (#4906)

API Changes

  • core: the CallCredentials API is going through an API incompatible change, scheduled for next release. Implementations are encouraged to migrate to implementing CallCredentials2 to avoid breakage next release, although at some point in the future CallCredentials2 will be removed. Consumers of CallCredentials are NOT affected. (#4902) See #4901 for the migration roadmap and further details
  • protobuf: Added ProtoUtils.setExtensionRegistry() for decoding. This should be preferred over ProtoLiteUtils.setExtensionRegistry() when using full protobuf, since the shared configuration between ProtoUtils and ProtoLiteUtils is an implementation detail
  • netty: NettyChannelBuilder.localSocketPicker() can be used to bind to a specific local address
    services: Binary logs moved from v1alpha to v1 of binary logging proto, this is an incompatible format change (#4846)

API Stabilization

  • core: Stabilized AbstractStub.withExecutor

Behavior Changes

  • core: channel tracing now records events for load balancing policy change
  • okhttp: AsyncFrameWriter log quietly when socket is already closed, also default log level is INFO for AsyncFrameWriter#close. This reduces log spam (#4927)
  • core: remove redundant SubchannelPicker refreshes in RoundRobinLoadBalancer. This avoids resetting the current round robin index when unnecessary, providing smoother load distribution
  • core: ignore localhost and IP addresses for SRV and TXT DNS lookups. Looking up SRV and TXT records is still disabled by default
  • alts: fail calls when using ALTS if not running on Google Cloud Platform (#4807)

Acknowledgements

Thanks to all our external contributors: