Releases: grpc/grpc-java
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
GoogleCallCredentialscan now be sent via ALTS channel (#4657)- Correctly determine
--use_alts defaultin 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 onOkHttpChannelBuilderbefore passing it toAndroidChannelBuilder.fromBuilder(). WhileAndroidChannelBuilderstill 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
GoogleDefaultChannelBuilderthat 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=trueand 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
StatusExceptionandStatusRuntimeException’s constructors with trailers are now stabilized (#4686).StatusExceptionandStatusRuntimeException’sgetTrailers()are now stabilized (#4697)
Behavior changes
- Channel tracing:
- Round-robin load balancer now randomizes the starting index for each new list (#4462)
InProcessSocketAddressnow forbids null names and has better-defined equality. (#4728)- The protoc plugin now generates Java code with
@Deprecatedifoption deprecated = trueis set from the proto file (#4741)
Acknowledgements
Thanks to all our external contributors:
v1.14.0
Notice: This is expected to be the last version supporting Java 6. Comment on #3961 if this causes you trouble. Android API level 14 support will be unchanged.
Dependencies
-
Updated to Netty 4.1.27 and Netty TCNative 2.0.12
-
gRPC is now regularly tested with JDK 9 and 10
-
Warning, a bug was discovered after this release where using Netty Epoll would increase memory usage. Please avoid this release of gRPC if you know you use Netty Epoll
API Changes
OkHttpChannelBuilder#negotiationTypeis now deprecated- Made protobuf, protobuf-lite, and protobuf-nano classes final.
New Features
- Channel Tracing now record State Changes
- Stubs now have an
RpcMethodannotation for use with annotation processors - Added support for providing
List<EquivalentAddressGroup>to LoadBalancer Subchannels, in addition to the option of providing aEquivalentAddressGroup(EAG). This prevents the need forLoadBalancers to "flatten" aList<EquivalentAddressGroup>into a singleEquivalentAddressGroupwhich loses/confuses the EAG'sAttributes.NameResolvers can now specifyAttributesin an EAG and expect that the values are passed to gRPC's core. Future work will addList<EAG>forOobChannels. - InProcessSocketAddress now has a useful
toString()method - AndroidChannelBuilder is now easier to build
- RoundRobinLoadBalancer now scales better when using stickiness
Behavior Changes
- gRPCLB no longer depends on having a Service Config
Bug Fixes
- Fix regression that broke Java 9 ALPN support. This fixes the error "SunJSSE selected, but Jetty NPN/ALPN unavailable" (#4620)
- Fixed a bug with gRPC LB parsing SRV DNS records ( 6dbe392 )
enterIdle()will exit idle mode if channel is still in use (#4665)TransmitStatusRuntimeExceptionInterceptornow avoids accidentally double closing the call.
Documentation
- Clarified
StreamObserverinteraction with thread safety
Thanks to all our Contributors:
v1.13.2
v1.12.1
v1.13.1
v1.13.0 wasn’t published to maven central due to a releasing process issue and the tag was deleted. The binaries of v1.13.0 were effectively the same as v1.13.1.
Dependencies
- Netty version bumped to 4.1.25-Final and netty-tcnative bumped to 2.0.8.Final
- OpenCensus version bumped to 0.12.3
- Special thanks: Bogdan Drutu
- Dependency on OpenCensus was removed from the Bazel target io_grpc_grpc_java//core
- services: Use RE2/J
- Special thanks: Nathan Herring
- alts: Added grpclb runtime
API changes
- Generated RPC Stubs no longer have the static field MethodDescriptors like
FOO_METHOD ProtoUtilsnow hasmetadataMarshalleranalogous toProtoLiteUtils- Experimental
jsonMarshallerhas been removed from grpc-java library (and added into examples) - Added
@CheckReturnValueannotation toAbstractStub,CallOptions, andContext- Special thanks: Grant Oakley
CallOptionsAPI: DeprecatedCallOptions.Key.of, addedCallOptions.Key.createandCallOptions.Key.createWithDefault, and stabilizedCallOptions.KeyandCallOptions.withOption- Stabilized
ManagedChannelBuilder.maxInboundMessageSizeAPI
New features
- Introduced JUnit test rule
GrpcCleanupRulewhich is more flexible to use thanGrpcServerRule - Channelz Service can now be added to a server to expose stats for all gRPC channels or servers in the process
Behavior changes
- auth: Require
PRIVACY_AND_INTEGRITYforGoogleCredentials - core,stub: Added
toString()toClientCallImplandGrpcFuture- Special thanks: Grant Oakley
Bug fixes
- Fixed Bazel compilation in Java 9
- Special thanks: David Ostrovsky
- Fixed a bug that client does not detect truncated message
- Fixed a bug of
Attributes.hashCode()method - security: Propagate
CallCredentials.ATTR_SECURITY_LEVELfrom transports
Documentation
- Documented Metadata ownership passes to the
ClientCallandClientCall.Listener - Clarified that Android is for client-side use in README.md
- Fixed missing comment for headers param in
ServerInterceptor.interceptCallAPI- Special thanks: Jianwei Mao
- Added Kotlin and Kotlin android examples
v1.12.0
Dependencies
- java_grpc_library (Bazel): re-add grpc-java repo to targets (#4288). This fixes the breakage of java_grpc_library in v1.11.0
- examples: upgrade protobuf-maven-plugin to 0.5.1 (#4307)
API changes
- Publicly visible but not yet shipped features (do not use these APIs): ChannelzService, BinaryLogProviderImpl
- cronet: added
CronetChannelBuilder.scheduledExecutorService()so application can be in control of all threads (#4249) - netty,okhttp: always set
TRANSPORT_ATTR_REMOTE_ADDR(#4217) - testing: GrpcServerRule is now a final class (#4264). There should be no reason to extend it
- core, netty: allow InputStream based server certs (#4316). This adds
InputStreamoverloads forServerBuilder.useTransportSecurity()andGrpcSslContexts.forServer()
New features
- netty: Add support for Conscrypt (#3401). Conscrypt may now be selected automatically when it is in the Security provider list
- okhttp: support JDK9 ALPN (#4136)
- android: add
AndroidChannelBuilder(#4172). This is an Android-oriented builder and able to receive an Android Context. - Experimental Service Config Support. This enables live updating of RPC attributes, (such as retries, deadlines, and more). This can be enabled by setting
-Dio.grpc.internal.DnsNameResolverProvider.enable_jndi=trueand creating the appropriate DNS TXT record. This will be documented more thoroughly in the near future. There are numerous caveats with this feature and thus is not ready for general usage. - Experimental Retry Support. This feature depends on service config and both will be documented more thoroughly in the near future. There are numerous caveats with this feature and thus is not ready for general usage. Today, this feature requires disabling Census stats and tracing. (Feedback or suggestions on desired behavior with Census enabled are very welcome!)
- java_grpc_library: Add support for protobuf lite (#4289). Users can specify flavor=”lite”
Behavior changes
- core,netty: client sends RST_STREAM when server half-closes (#4222)
- core: re-add back in orphan wrapper (#4229). A warning will be logged when a ManagedChannel is not shut down properly. The user should wait for
awaitTerminated()to returntrueor callshutdownNow()to avoid the warning - cronet: delay cast to ExperimentalCronetEngine (#4230). This restores the v1.11 behavior as a temporary workaround for some tests passing a mocked CronetEngine
- core: ManagedChannel now has a “panic mode” (#4245). Any internal exceptions (which implies a bug) will cause the channel to permanently enter the TRANSIENT_FAILURE state
- okhttp: Convert to internal ConnectionSpec eagerly and deprecate
OkHttpChannelBuilder.DEFAULT_CONNECTION_SPEC(#4267). AfterDEFAULT_CONNECTION_SPECis removed this will save around 40 methods - interop-testing: client compressed tests without probing (#4279). For other implementations using the tests for compatibility checking, this allows running some tests in environments where the full set of assertions can’t be checked
- core: don't reschedule idle timer if it is already active (#4297). This can reduce latency for channels with few concurrent RPCs
- compiler: allow capitalized java keywords as rpc names (#4309)
- core: always call StreamTracer.streamClosed() when stream is officially closed. (#4331)
- core: forward toString for forwarding classes (#4337)
- all: add toString() to Server to improve debug info (#4340)
Bug fixes
- netty: support graceful server shutdown by sending 2 GOAWAYs (#4227)
- grpclb: Cache Subchannels for 10 seconds after it is removed from the backendlist (#4238)
- okhttp: fix HPACK reader bug (#4276)
- okhttp: properly verify IPv6 address hosts (#4292)
- core: fix memory leak when inbound message was not fully read (#4298). This mainly applies to custom message marshallers; it would be very rare for the protobuf marshaller.
Documentation
- core: added docs about grpc-java-api-checker to README.md and the Internal and ExperimentalApi annotations (#4182)
- SECURITY.md: Add reference to grpc-netty-shaded (#4185)
- SECURITY.md: Added more troubleshooting instructions (#4236)
- protobuf: fix
@sinceforStatusProto.fromStatusAndTrailers(#4287) - doc: upgrade protobuf-maven-plugin in README.md (#4295)
- stub: add docs clarifying flow control readiness (#4342)
- core: Fix experimental API issue for channel state API to point to #4359 instead of long-closed #28 (#4360)
v1.11.0
Dependencies
- Guava version bumped to 20. It is not possible to use older versions of Guava with this version of gRPC. If this proves difficult to handle, please file an issue
- netty: Netty version bumped to 4.1.22-Final. netty-tcnative 2.0.7.Final is still compatible
API changes
- core:
ManagedChannelBuilder.usePlaintext(boolean)is now deprecated. UseusePlaintext(void)instead, which is equivalent tousePlaintext(true).usePlaintext(false)was almost always a bug, but is still available by specifyingNegotiationType.PLAINTEXT_UPGRADEtoNettyChannelBuilder - bazel: grpc-java's Bazel workspace name was renamed to io_grpc_grpc_java. This was done to make the name more unique, since Bazel is now enforcing that users use the same name as in our workspace
New Features
- core: Added ManagedChannel.enterIdle(). It gracefully shuts down any existing connections. This can have multiple uses, but is most immediately useful to allows smooth network interface changes on Android (#3688 #4179)
- core: Added toString() to MethodDescriptor and ServiceDescriptor (#4013)
- inprocess: Added InProcessServerBuilder.generateName(). This is a convenience for making a name instead of manually with UUID or similar
- okhttp: Support for Conscrypt security provider. This allows you to include Conscrypt with your app and not depend on the OS nor Google Play Services Dynamic Security Provider for TLS support
- inprocess: Added
InProcessChannelBuilder.scheduledExecutorService(exec)to override the default timer executor used by gRPC - okhttp: Added
OkHttpChannelBuilder.scheduledExecutorService(exec)to override the default timer executor used by gRPC - protobuf: Added
StatusProto.fromStatusAndTrailers()to convert to acom.google.rpc.Statusdirectly from aio.grpc.Status(instead of aStatus*Exception) - alts: Added ALTS transport for Google Cloud Platform usage. It is similar to mutually authenticated TLS but with different protocol and trust model. ALTS is currently only available for whitelisted projects
- cronet: Added API to apply TrafficStats tag and UID to Cronet GRPC channels (#4208)
Behavior changes
- core: ManagedChannel will now log when orphaned without proper shutdown (#4093)
- core: Use exponential backoff for name resolution. After a NameResolver calls onError(), the channel will now automatically call
refresh()after a delay. This replaced the hard-coded 60-second retry timer in the DNS name resolver. (#4105) - core: Added an internal panic mode for ManagedChannel. If the channel notices an internal uncaught exception it will attempt to put the channel into a permanent TRANSIENT_FAILURE state instead of hanging (#4023)
- core: Servers that send too many or too few responses for a unary call will now properly see
ServerCall.Listener.onCancel()called instead ofonComplete(). The client will now see a cancellation instead of an explicit status message (#3819) - grpclb: Enter fallback mode immediately when balancer and all backend connections are lost (#4007)
Bug fixes
- Reduce false positive results of grpc/grpc-java-api-checker
- core: Close InputStream returned by Marshallers for outgoing messages (#3419)
- core: Fixed channel.getState(true) will not reconnect (#4170)
- netty: Include more details for closure of unknown reason
- netty: Client sends rst stream when server half-closes. This fixes a memory leak when server closes before client half closes (#4275)
- netty: Fixed
ProxySelectorwith Netty. This should finally enable the use of forward proxies that require authentication. Users should be able to migrate fromGRPC_PROXY_EXPto-Dhttps.proxyHostat this time (#4137) - okhttp: Fixed HPACK reader bug. This resolves an incompatibility with nginx (#4277)
Documentation
- examples: Added a "hello-world" with TLS configured