Releases: grpc/grpc-java
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:
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#negotiationType
is now deprecated- Made protobuf, protobuf-lite, and protobuf-nano classes final.
New Features
- Channel Tracing now record State Changes
- Stubs now have an
RpcMethod
annotation 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 forLoadBalancer
s to "flatten" aList<EquivalentAddressGroup>
into a singleEquivalentAddressGroup
which loses/confuses the EAG'sAttributes
.NameResolver
s can now specifyAttributes
in an EAG and expect that the values are passed to gRPC's core. Future work will addList<EAG>
forOobChannel
s. - 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)TransmitStatusRuntimeExceptionInterceptor
now avoids accidentally double closing the call.
Documentation
- Clarified
StreamObserver
interaction 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
ProtoUtils
now hasmetadataMarshaller
analogous toProtoLiteUtils
- Experimental
jsonMarshaller
has been removed from grpc-java library (and added into examples) - Added
@CheckReturnValue
annotation toAbstractStub
,CallOptions
, andContext
- Special thanks: Grant Oakley
CallOptions
API: DeprecatedCallOptions.Key.of
, addedCallOptions.Key.create
andCallOptions.Key.createWithDefault
, and stabilizedCallOptions.Key
andCallOptions.withOption
- Stabilized
ManagedChannelBuilder.maxInboundMessageSize
API
New features
- Introduced JUnit test rule
GrpcCleanupRule
which 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_INTEGRITY
forGoogleCredentials
- core,stub: Added
toString()
toClientCallImpl
andGrpcFuture
- 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_LEVEL
from transports
Documentation
- Documented Metadata ownership passes to the
ClientCall
andClientCall.Listener
- Clarified that Android is for client-side use in README.md
- Fixed missing comment for headers param in
ServerInterceptor.interceptCall
API- 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
InputStream
overloads 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=true
and 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 returntrue
or 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_SPEC
is 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
@since
forStatusProto.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_UPGRADE
toNettyChannelBuilder
- 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.Status
directly 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
ProxySelector
with Netty. This should finally enable the use of forward proxies that require authentication. Users should be able to migrate fromGRPC_PROXY_EXP
to-Dhttps.proxyHost
at this time (#4137) - okhttp: Fixed HPACK reader bug. This resolves an incompatibility with nginx (#4277)
Documentation
- examples: Added a "hello-world" with TLS configured
v1.10.1
v1.10.0
Dependencies
- Update opencensus to 0.11.0 (#3993)
Bug fixes
- bazel: fix protobuf sha256 (#3924)
- core: fix regression in v1.9.0 where the user-agent would be like "grpc-java-netty1.9.0" instead of "grpc-java-netty/1.9.0" (#3974)
- netty: workaround Netty regression in v1.9.0 (netty/netty#7639) which caused TLS failures to fail with "UNAVAILABLE: Channel closed while performing protocol negotiation" instead of useful failure information (#3997, #4030)
- netty: avoid NullPointerException in NettyServerHandler.newStreamException (#3932)
- core: MethodDescriptor.toBuilder() now copies the schemaDescriptor (#3941)
- core: change
@Internal
and@ExperimentalApi
retention policies to CLASS, to enable the upcoming grpc/grpc-java-api-checker to access these annotations (#3994) - compiler: avoid invoking experimental method in generated code, to clean up the output of the upcoming grpc/grpc-java-api-checker (#4055)
API changes
- core: delete outboundMessage() and inboundMessage() on StreamTracer. (#4014)
- core: deprecate passing ServerCall to StatsTraceContext (#3912)
Features:
v1.9.1
Bug fixes
- bazel: fix protobuf sha256 (#3924)
- core: fix regression in v1.9.0 where the user-agent would be like "grpc-java-netty1.9.0" instead of "grpc-java-netty/1.9.0" (#3974)
- netty: workaround Netty regression in v1.9.0 (netty/netty#7639) which caused TLS failures to fail with "UNAVAILABLE: Channel closed while performing protocol negotiation" instead of useful failure information (#4033)
- netty: fix regression in v1.9.0 where using GRPC_PROXY_EXP with the Netty transport would cause an UnresolvedAddressException (#4027).
ProxySelector
(including the default one that processes-Dhttps.proxyHost
) is still known-broken for Netty; this is being tracked in #4029