Releases: grpc/grpc-java
Releases · grpc/grpc-java
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
v1.9.0
Features
- core: record RPC upstarts to Census. Combined with the number of RPC completions, users can derive count of active RPCs. (#3708)
- core,okhttp: handle unresolved proxy addresses (#3789)
- core: user-agent is now supported in InProcess (#3853)
- netty: server sockets now configurable (#3755)
- netty: grpc-netty-shaded is now available as an alternative to grpc-netty. It shades grpc-netty and netty, so that users can safely depend on a different version of netty. It is safe to have both grpc-netty and grpc-netty-shaded as dependencies (#2485)
- cronet: allow multiple annotation objects attached to stream (#3695)
- compiler: the code-generator is now buildable on aarch64 (#3785)
- core/grpclb: resolve TXT records in DNS name resolver and include balancer addresses. This is part of larger work that’s still in progress, so is disabled by default. It can be enabled via
-Dio.grpc.internal.DnsNameResolverProvider.enable_jndi=true
(#3852)
API changes
Stabilized
New
- Add
useTransportSecurity()
inManagedChannelBuilder
. This can be used to reverse the effects ofusePlaintext()
(#3561)
Deleted
noopMethodDescriptor
,NoopClientCall
,NoopServerCall
, various APIs fromTestUtils
. These were previously marked deprecated (#3790)DeadlineSubject
removed from the testing package to avoid requiring newer Guava versions brought in by the Truth dependency. We anticipate few users will be impacted; if this impacts you please open an issue (#3786)
Behavior changes
- auth: Treat
IOExceptions
asUNAVAILABLE
. Previously they wereUNAUTHENTICATED
. This only applies when retrieving credentials, like OAuth tokens (#3757) - core: Increase server handshake timeout to 120s (#3799)
- grpclb: switch to fallback mode if all connections are lost (#3744)
Performance improvements
- auth: Use async version of
getRequestMetadata()
and avoid usingDelayedStream
and a thread hop when the credentials are known immediately. (#3758)
Dependencies
- Switch from
com.google.instrumentation
toio.opencensus
0.10.0
for stats reporting. (#3647) proto-google-common-protos
upgraded to1.0.0
(#3765)- netty: netty upgraded to
4.1.17-Final
(#3770). Users will need to upgrade to netty-tcnative2.0.7.Final
. - okhttp: okio upgraded to
1.13.0
(#3806) - Protobuf upgraded to
3.5.1
(protoc to3.5.1-1
) (#3921)
Bug fixes
- core: no ProxyDetector for GAE+JDK7 (#3677, fixes #3676)
- netty: fix server keepalive unexpected ping ack (#3730, fixes #3684)
- netty: fix unknown content type handling on server (#3735, fixes #3370)
- core: workaround for
Atomic*FieldUpdater
bug on some Samsung Android 5.0.x devices (#3754) - core: fixed Attributes value equality (#3859, fixes #3857)
v1.7.1
- core: Added handshake timeout for all server transports. The default is 120 seconds, which matches the client-side timeout. The default can be overridden by
ServerBuilder.handshakeTimeout()
- netty: Fixed broken server keepalive when using TLS. If using Netty server, server keepalives, and TLS, you were impacted. Plaintext did not exhibit the bug. This could trigger grpc-java clients to log "WARNING: Received unexpected ping ack. No ping outstanding."
v1.8.0
Dependencies
- core: Now using io.opencensus:opencensus-api and io.opencensus:opencensus-contrib-grpc-metrics instead of com.google.instrumentation:instrumentation-api for stats and tagging. The gRPC Monitoring Service continues to use instrumentation-api.
- examples: In Android example, bump minSdkVersion to 14. Google Play Services, which is used for TLS, bumped their minimum supported version
API Changes
- core: Removed deprecated load balancer and name resolver APIs. This includes
LoadBalancer.handleResolvedAddresses()
,LoadBalancer.Helper.updatePicker()
,NameResolver.Listener.onUpdate()
,ResolvedServerInfo
, andResolvedServerInfoGroup
- stub: Added
@DoNotMock
annotations toAbstractStub
,CallStreamObserver
,ClientCallStreamObserver
,ServerCallStreamObserver
. The normal gRPC implementations of these classes should be used in tests - codegen: Removed
enable_deprecated
protoc plugin option (#3541). These deprecated APIs pre-date 1.0 and were off by default - codegen: Added methods for accessing generated method descriptors. This replaces the
METHOD_FOO
constants with staticgetFooMethod()
methods. The constants are deprecated and will be removed in a future release. Once the constants are removed, this change will allow the descriptors (and the messages they reference) to be lazily created which can dramatically decrease class initialization time and allows unused RPC messages to be removed by Proguard. - testing:
TestMethodDescriptors.noopMethod()
is deprecated in favorvoidMethod()
or test services. The simple service in grpc-testing-proto should work in most cases wherevoidMethod()
is insufficient - testing: Marked
DeadlineSubject
experimental. It is planned for removal to ease future Guava dependency issues with Truth. It could be moved into its own artifact, but best as we can tell nobody is using it. If you're using it, please file an issue so we can be made aware - testing: Deprecated
StreamRecorder
. It will be removed in a future release. The class is very old (since the beginning in OSS) and was used in internal tests before there were blocking stubs. Most users should use blocking stubs instead. To use properly, you must know the class's implementation; if you liked it, copy the code to your own codebase - testing: Deprecated
TestUtils.recordServerCallInterceptor()
. It will be removed in a future release. It has no known use cases for normal users - The (unreleased) Thrift support has been removed from this repository. It can be found at https://github.com/grpc-ecosystem/grift instead
New Features
- The Cronet transport is open-sourced. Cronet is Chrome's network stack made into a library for mobile. We do not provide a build file nor are we making binaries, but if you're interested it shouldn't be too hard to build manually
- context:
CancellableContext
now implementsCloseable
(#3607).close()
is an alias forcancel(null)
. This should make it more clear that the context needs to be cancelled/closed, while also enabling try-with-resources - core:
Attributes.Builder.build()
may now be called multiple times - core: Added first-class drop support for load balancers via
PickResult.withDrop(Status)
. This is necessary if the LB wants to failwaitForReady
RPCs to shed load - core: Added
MethodDescriptor.getSampledToLocalTracing()
/Builder.setSampledToLocalTracing
to permit per-method stats keeping memory overhead (#3627). The option is to prevent unbounded memory overhead when dynamically-created MethodDescriptors are used and is enabled in the generated code. - core: Added
resetConnectBackoff()
method toManagedChannel
. This can be used when the OS notifies your application that the network has become available - stub: Added
stub.withExecutor(Executor)
. This was already available on CallOptions and can be used to specify a call-specific executor to use for callbacks - testing: Added
TlsTesting.loadCert
as an alternative to deprecatedTestUtils.loadCert
. The TlsTesting version returns anInputStream
instead of aFile
which avoids creating temporary files
Behavior changes
- core: Added handshake timeout for all server transports. The default is 20 seconds (which is a bug; should be 120 seconds to match client-side). The default can be overridden by
ServerBuilder.handshakeTimeout()
- core: LoadBalancer callbacks will no longer be called after shut down (#3573). This changes the behavior to match that documented in
LoadBalancer.shutdown()
- core: Refresh name resolution when an OOB connection is closed (#3588). This has already been happening for Subchannels.
- netty,okhttp: Now detecting proxy via
ProxySelector
. This enables observation of the Java-standard proxy options-Dhttps.proxyHost=host -Dhttps.proxyPort=port
.Authenticator
is consulted for along with auth. Users of theGRPC_PROXY_EXP
environment variable should migrate; the environment variable will be removed in a future release. - netty: Connection log info has been moved to a separate logger:
io.grpc.netty.NettyServerTransport.connections
(#3591). - auth: Treat
IOExceptions
asUNAVAILABLE
instead ofUNAUTHENTICATED
(#3267). This allows retrying RPCs if the OAuth token failed to be retrieved
Bug fixes
- core: Fixed ManagedChannel docs since it supports the getState/notifyWhenStateChanged API (#3762)
- core: When Context cancellation cancels an RPC, and the Context cancellation cause is
null
, we now include a description in the Status to help expose what happened - netty: Fixed broken server keepalive when using TLS. If using Netty server, server keepalives, and TLS, you were impacted. Plaintext did not exhibit the bug. This could trigger grpc-java clients to log "WARNING: Received unexpected ping ack. No ping outstanding."
- netty: Improved ALPN error message to be less misleading and link to troubleshooting procedures
- netty: Fixed clearing of SSLParameters. This may fix ALPN with JDK9, but full support for ALPN with JDK9 is still later work and not supporting it yet. Fixes #3532
- netty: When a RST_STREAM kills an RPC, we now include the HTTP/2 error code in the Status
- netty: Fixed Netty server poorly handling unknown content type. It previously would refuse the stream; now it responds with a normal grpc status and HTTP error code
- bazel: java_grpc_library: Fixed remote protos that are 'src's. Fixes #3650
- examples: Replaced IntelliJ IDEA-specific sourceDirs with sourceSets. This helps Eclipse and other IDE users
Documentation
- SECURITY.md now includes a table showing the preferred Netty and netty-tcnative version for each grpc-java release
- SECURITY.md clarify that the Dynamic Security Provider must be installed before OkHttp channel creation
1.7.0 Release
Important Changes:
- Update protobuf to 3.4.0
- Update netty to 4.1.16. Users will need to use netty-tcnative 2.0.6 or later.
Features:
- Provide demos for manual flow-control and back-pressure
- Beginning of support for full-stream compression (as an alternative to per-message compression). Currently only client-side decompression is implemented. This work is experimental
- io.grpc.Context now emits a SEVERE warning if it detects the length is abnormally long
- Record individual message sizes with Census/Tracing
- Allow to fallback to ServiceLoader.load without Classloader to make gRPC more OSGi friendly
- Minor memory reductions
- ManagedChannels log a warning when not properly shutdown
Bug Fixes:
- Fix GET support in OkHttp client to actually use HTTP GET. This is still considered experimental.
- Fix Bazel naming mixup with gson and opencensus. This only matters if you were passing
omit_com_google_code_gson=True
oromit_io_opencensus_api=True
togrpc_java_repositories()
(#3379) - Fix Bazel
java_grpc_library()
rule when depending on protos in external repos (#3483) - Fix transport improperly notifying Channel of its use in certain cases. This could cause spurious disconnections when
idleTimeout()
is configured on the Channel (#3374) - We now wait until all streams are closed before gracefully terminating a Netty connection. There was previously a five second timeout (#3386)
Incompatible Changes:
- Metadata entries for reserved headers are stripped (“user-agent”, “content-type”, “te”)
- InprocessChannelBuilder and InprocessServerBuilder now throw an exception when using the static constructor inherited from their base class. These didn't do what users expected, as they were actually just calling the ManagedChannelBuilder/ServerBuilder methods.