Releases: grpc/grpc-java
1.3.0 Release
New Features
- Netty client: Connection Keepalives now work.
- Keepalives in Netty and OkHttp now allow sending pings without outstanding RPCs. The minimum keepalive time was also reduced from 1 minute to 10 seconds. Clients must get permission from the services they use before enabling keepalive.
- Netty server: now detects overly aggressive keepalives from clients, with configurable limits. Defaults to permitting keepalives every 5 minutes only while there are outstanding RPCs, but clients must not depend on this value.
- Netty server: can now use keepalives to detect dead connections
- Netty server: can now enforce a maximum connection age. This is useful when using pick-first or behind a L4 load balancer
- Netty client: can now use HTTP GET for safe and idempotent RPCs. Netty server does not yet accept these RPCs. This is experimental with planned incompatible wire format changes
- Added
io.grpc.protobuf.StatusProtofor working withcom.google.rpc.Status, which can include additional error details - Introduced
StreamTracers on client- and server-side. These can be used by tracing frameworks andLoadBalancers to be notified of relevant RPC events and details. OkHttp and Netty support the tracers, but InProcess does not
API Changes
MethodDescriptor.Builderis now non-experimental- The alias from
LoadBalancer2toLoadBalancerwas removed as planned LoadBalancer.SubchannelPicker.pickSubchannel(Attributes, Metadata)was deleted as planned in favor of the more extensibleLoadBalancer.SubchannelPicker.pickSubchannel(PickSubchannelArgs)CallOptions.withAffinityis now deprecated in favor ofwithOptionand will be removed in the next releaseNettyChannelBuilder.andOkHttpChannelBuilder.enableKeepAliveis now deprecated in favor ofkeepAliveTimeandkeepAliveTimeoutand will be removed in the next releaseResolvedServerInfoGroupandResolvedServerInfoare deprecated and are planned for deletion in the next release
Bug fixes
- The Netty transport now handles the Netty Channel failing to be constructed by cleanly reporting the error. Previously this would cause a NullPointerException. This is generally useful for debugging broken shading configuration
- OkHttp: Fix compatibility issue with newer versions of Conscrypt
1.2.0 Release
New
- The new Load Balancer API (and ManagedChannelImpl) is now default; the previous one is removed (#2656)
- The authority header is now included when looking up methods in the HandlerRegistry (#2709)
Changes
- Downgraded Guava to 19. This should help avoid ABI problems with older versions of Guava
- Fixed a bug with connections dropped due to HTTP/2 settings frames (#2820)
- Upgraded to Protobuf 3.2
Fixed an error when using keep alives with Netty (#2729)Edit: the feature is still broken (#2828)- SETTINGS_MAX_HEADER_LIST_SIZE is now sent in the initial HTTP/2 settings (#2350)
- Fixed a race in the server start and shutdown when using Netty (#2672)
- Indexes for server reflection are consistent for the duration of the RPC. (#2767)
1.1.2 Release
This is a patch release to the 1.1 gRPC branch that fixes two minor issues:
- Fixed an accidental dependency from the
grpc-allartifact on the yet to be releasedgrpc-thriftartifact - Make the new load balancer API non abstract as to not break existing ManagedChannelBuilder implementations.
1.1.1 Release
I am pleased to announce availability of gRPC Java 1.1.1, the next minor release of gRPC. This includes several months of changes made since 1.0.3. There are many bug fixes, API improvements, and performance changes in this release.
Major Changes
- Preview of New Load Balancer API The previous API for implementing a new load balancer had several structural issues (#1600 #2209 #2301 #2302) that made it difficult to assign load intelligently to backends. The V2 API is available for trial use in this release. The classes are suffixed with a "2". They will be renamed in the next release of gRPC, and the the current implementations will be removed. Note that these APIs are still considered experimental and not guaranteed to be stable yet. See the notice.
- Server Reflection It is now possible to enable server side reflection when using Protobuf generated stubs. This allows remote clients to inquire as to which supported services and methods the server can process. It is currently opt in, by adding ProtoReflectionService to an existing server.
- New Context Artifact Context, the means by which deadlines and cancellation are propagated across API boundaries is now in its own package in
grpc-context. It can (and will) be used for implementing cross RPC state, such as for stats and tracing. - Wait For Ready Also known as "fail fast", wait for ready has been implemented as an option in gRPC stubs. This can be used to indicate that an RPC should fail immediately if there are no healthy servers available.
- Proxy Support It is now possible to use basic HTTP CONNECT style proxy support (23f5a6f)
- _Service_ImplBase.bindService() is now final. The grpc-io mailing list was notified of our intentions and reasoning. This is a breaking change but is not expected to impact production code. If a test breaks, typically you can just remove the line resembling
Mockito.when(service.bindService()).thenCallRealMethod();. If this change causes you pain, please file an issue and we may revisit it.
Minor Changes
- Many classes have been made final. These classes were previously uninstantiable due to having private constructors, but were possible to use with a mocking framework (such as Mockito). These classes have been made final, and special testing utility classes have been provided for use instead.
- The generated stub classes have several new methods for indicating max message size.
- Stub classes also lazily load classes whenever possible. If a stub is generated from a very large proto file, or has many dependencies, this avoids loading them all when possible.
- Many more examples have been added and clarified. See the
examples/directory. - Multiple performance optimizations. gRPC is now more memory efficient, less lock contentious, and less CPU overhead. (24de243, 35c3f81, ca5a402, f78644d, 6d28a93, ea3f506, 8c18a0d, 8b745d9, 6907d81, 1623063, 141eed5, ef4e0f4, 8702185, 496a621, cb1ba5b)
- Guava collection classes are removed from the library, making it easier for Android users to lower their method count and binary size.
- Dependencies are upgraded to Guava 20, Netty 4.1.8, and Protobuf 3.1.0
- Status error messages have been made more clear, and should be easier to diagnose.
- Numerous small bug fixes
- Numerous small API changes.
Note that all classes marked @ExperimentalApi and @Internal aren't guaranteed to be API stable, and may be changed without notice. Classes and methods marked @Deprecated should be avoided and may be removed in a later release. Of note is ClientAuthInterceptor, which should be avoided in favor of MoreCallCredentials.
v1.0.3 Release
The v1.0.3 release has a small bugfix and experimental support for forward proxies. Only users of InProcess transport in tests or users wanting to test the forward proxy support benefit from the update.
- Remove a usage of an executor which was just to avoid lock ordering issues. Now the work is done on the same thread, but after locks are released. This fixes non-determinism when "connecting" with the InProcess transport (#2444)
- Add experimental support for http forward proxies via CONNECT to both Netty and OkHttp transports. Proxy authentication is unsupported. To enable, use the
GRPC_PROXY_EXPenvironment variable and set to ahost:port-formatted string. Error handling is known to be weak when negotiating with the proxy; most proxy failures will result in a generic error. Errors after negotiation completes are unaffected.
v1.0.2 Release
The v1.0.2 release is a bug fix release with no new features. The following specific fixes were backported from the master branch:
- Make the OkHTTP transport AppEngine friendly f52b4e5
- core: Fix a bug for exception handling at messageRead abb4a2a
- netty: Upgrade to 4.1.6 and tcnative Fork23 6fa63a6
- core: Update HTTP status to gRPC status mapping 78107a6
- core: fix bug when stream listener not set before stream closed 0e27eef
- core,netty: quick patch for setListener regression 0d694c8
v1.0.1 Release
- Moved
io.grpc.Contextandio.grpc.Deadlinefromgrpc-coreto its own artifact,grpc-context. This is to allow wider usage of the API and avoid circular dependencies.grpc-coredepends on the new artifact. (#2226) - Avoid creating unnecessary threads in InProcess transport, which improves performance for short-lived channels and prevents non-determinism when using direct executor in tests. (#2108)
- Fix bug where
Errors could end up being wrapped inRuntimeException(#2131) - Fix a deadlock in
TransportSet(#2258)
v1.0.0 Release
APIs and codegen are guaranteed stable, excluding APIs marked with @ExperimentalApi or @Internal, APIs within an internal package, and utilities like grpc-benchmarks and grpc-interop-testing. APIs marked @Deprecated in this release are not covered. Mocking frameworks purposefully break API assumptions, so we can't guarantee stability with them.
Changes since v1.0.0-pre2
- Fix a deadlock when scheduling connection reestablishment backoff
- Benchmarks: Swap to
ForkJoinPool, as the executor is the bottleneck for high CPU (16+ core), high QPS benchmarks. On smaller workloads using normalThreadPoolExecutoris faster - Android: New "route guide" example
- Android: helloworld example now prints full stacktrace on failure, which easies debugging
- Android: encourage using new protobuf-gradle-plugin v0.8.0 to slightly simplify protobuf-lite usage
- Minor documentation tweaks
v1.0.0-pre2 Release
Changes
- Update protobuf to v3.0.0
- grpc-protobuf-lite now depends on protobuf-lite. Since grpc-protobuf depends on grpc-protobuf-lite, grpc-protobuf explicitly excludes the protobuf-lite dependency and adds its own protobuf dependency. Everything should "just work" for most varieties of protobuf users, as both Maven and Gradle handle the dependencies correctly.
- Update README to every-so-slightly encourage lite instead of nano. We generally prefer lite as it is a more similar API to full protobuf, and it is the most actively maintained
- Fix a blocking unary stub bug introduced in v1.0.0-pre1 that wrapped the status in an additional status
- Minor fixes
v1.0.0-pre1 Release
API Changes
- Generated interfaces and methods that were deprecated in v0.15.0 are now removed. To ease migration, the grpc protoc plugin supports the option
enable_deprecated=truewhich will re-enable the old generated APIs. This option will be removed in a later release.- Mocking stubs is no longer supported. Most tests should use the inprocess transport, which is fast and lightweight, especially when using
directExecutor()for both the client and server. Some tests may need to use aClientInterceptorto verify theCallOptions. We plan to improve convenience utilities over time; please file a bug for testing issues or suggested utilities.
- Mocking stubs is no longer supported. Most tests should use the inprocess transport, which is fast and lightweight, especially when using
- Reduced default max message size from 100 MiB to 4 MiB.
ManagedChannelBuilder.maxMessageSize()andServerBuilder.maxMessageSize()can override the default. Larger sizes are not a problem for grpc, but applications should be aware when they may receive large messages.
New Notables
- Update Netty to 4.1.3.Final. This resolves a flow-control accounting, off-by-one bug when interoperating with HTTP/2 implementations that use padding (netty/netty#5434). The off-by-one accumulates over time, which could eventually hang a long-lived TCP connection. gRPC implementations do not use padding today, nor do most HTTP/2 proxies. Google's GFE does use padding which impacts all Google-hosted APIs, but requires receiving GBs per connection before triggering a hang.
- Channel can now enter IDLE after a period of no RPCs, which can be enabled via
ManagedChannelBuilder.idleTimeout(). IDLE disconnects the TCP connection and shuts down the name resolver and load balancer. This is generally useful for reducing resources, but can also be used on Android to avoid broken TCP connections on bad networks and "avoid" timeouts of NATs and load balancers. - Keepalive support for OkHttp, which can be enabled via
OkHttpChannelBuilder.enableKeepAlive(). Keepalive uses HTTP/2 PINGs while RPCs are in progress to monitor the TCP connection and signal activity to NATs and load balancers. Keepalive does nothing if no RPCs are in progress, thus is primarily useful when for long-lived streaming RPCs. This implementation preempts the design of keepalive being finalized, but was important enough for mobile networks to have something available sooner. This can be used on Android to detect broken TCP connections on bad networks and reset timeouts of NATs and load balancers. - Revamped compilation of examples. Examples are now divorced from the rest of grpc-java's build process. Maven can now be used to build the examples, and the Gradle build file is simplified. Both builds are intended to be copyable for your own project.
Other
- Hard-code providers list for Android, moving away from
ServiceLoaderon the platform. If your application never callsClass.getResource(), this will reduce memory on some Android versions and speed construction of your firstManagedChannel. This also simplifies the necessary ProGuard configuration. General-purpose 3rd-party providers for NameResolver and ManagedChannel that may be used on Android should request to be added to the hard-coded list. ClientCall.cancel(String, Throwable)is now a required method and will log a warning when called with neither a message nor cause. This completes the migration fromClientCall.cancel(void)which was very difficult to debug where cancel was called.- Bug fix:
StatusRuntimeExceptions for blocking unary calls should now include trailers. - Miscellaneous fixes.