Releases: grpc/grpc-java
v1.20.0
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:
- Nick Hill (@njhill) (#5504, #5506, #5492)
- Tim van der Lippe (@TimvdLippe) (#5484)
- Fabio Kung (@fabiokung) (#5443)
- Derek Perez (@perezd) (#5384)
- Brendan Linn (@Ubehebe)(#5456)
- AmiDavidW (@AmiDavidW) (#5358)
- Rodrigo Queiro (@drigz) (#5411, #5410)
- Nguyen Quang Huy (@huynq0911) (#5387, #5388)
- David Hoover (@deadmoose) (#5379)
- Dan (@danfaer) (#5373)
- Dan Torrey (@danotorrey) (#5472)
v1.19.0
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
- SECURITY.md recommendations updated and reorganized (#5281)
Acknowledgments
Thanks to all of our contributors:
- Arajit Samanta @arajitsamanta
- Bogdan Drutu @bogdandrutu
- Danna Kelmer @dkelmer
- Ignacio del Valle Alles @idelvall
- Michael Plump @plumpy
- Tim van der Lippe @TimvdLippe
- Yang Song @songy23
- kenji yoshida @xuwei-k
v1.18.0
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 (notround-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
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
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
Do not use this release. Its handling of gRPCLB causes problems for the ecosystem
Known Issues
- Since SRV lookup was enabled in this release, services enabling grpclb would break clients that lack the grpc-grpclb dependency. This effectively makes it impossible for existing services to enable gRPC LB
- Bazel apps lacking a (transitive) dependency on @io_grpc_grpc_java//core:util will fail at runtime. See detail / workaround for more detail
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()
toManagedChannelBuilder
andServerBuilder
(#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 newCallCredentials2.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
v1.16.0
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:
- Grant Oakley @groakley
- Jesse Wilson @swankjesse
- Nick Hill @njhill
v1.15.1
OkHttp users are encouraged to upgrade, although if you aren't seeing the particular error mentioned below then you aren't strongly impacted. This is normally because you are doing small RPCs.
Non-Android users are encouraged to try enabling gRPC-LB on client-side in their environment and report any problems, even if you aren't interested in gRPC-LB. This will cause additional SRV lookups from DNS. We want to make sure it won't cause issues before enabling it by default.
Bug fixes
- 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.
- core: DnsNameResolver now caches SRV results. Fixes #4745. This makes it "safe" to experiment with
-Dio.grpc.internal.DnsNameResolverProvider.enable_grpclb=true
, which will become the default in the future. We encourage users to try out the option and report back issues, especially additional connecting latency, to #4898.
v1.15.0
Important notice
Java 6 is no longer supported. Java 7 is the oldest supported Java version. Android support is unchanged at API level 14. See the announcement. Contrary to the announcement, grpc-context is requiring Java 7. If any Java 7 requirement is causing you issue, please file a GitHub issue.
Bug fixes
GoogleCallCredentials
can now be sent via ALTS channel (#4657)- Correctly determine
--use_alts default
in the usage printout (#4538) - Fixed NPE in
ProxyDetectorImpl
(#4677)
New Features
- Added
AndroidChannelBuilder.fromBuilder()
(#4723).transportExecutor()
,sslSocketFactory()
, andscheduledExecutorService()
are now deprecated in favor of calling the same methods onOkHttpChannelBuilder
before passing it toAndroidChannelBuilder.fromBuilder()
. WhileAndroidChannelBuilder
still depends onOkHttpChannelBuilder
, it no longer has to duplicate the API. - Implemented flush coalescing in OkHttp (#4763). This can reduce the number of packets sent when multiple RPCs are using the same channel
- Added
GoogleDefaultChannelBuilder
that sets up a secure channel using ALTS if on a properly configured Google Compute Engine instance and using TLS as fallback (#4742). In this release it adds little value unless you enable-Dio.grpc.internal.DnsNameResolverProvider.enable_grpclb=true
and have a GCE environment with ALTS enabled. In the future it will become the expected way to create a connection to googleapis.com.
API Stabilization
StatusException
andStatusRuntimeException
’s constructors with trailers are now stabilized (#4686).StatusException
andStatusRuntimeException
’sgetTrailers()
are now stabilized (#4697)
Behavior changes
- Channel tracing:
- Round-robin load balancer now randomizes the starting index for each new list (#4462)
InProcessSocketAddress
now forbids null names and has better-defined equality. (#4728)- The protoc plugin now generates Java code with
@Deprecated
ifoption deprecated = true
is set from the proto file (#4741)
Acknowledgements
Thanks to all our external contributors: