Skip to content

Releases: grpc/grpc-java

v1.15.0

11 Sep 22:35
Compare
Choose a tag to compare

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(), and scheduledExecutorService() are now deprecated in favor of calling the same methods on OkHttpChannelBuilder before passing it to AndroidChannelBuilder.fromBuilder(). While AndroidChannelBuilder still depends on OkHttpChannelBuilder, 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 and StatusRuntimeException’s constructors with trailers are now stabilized (#4686).
  • StatusException and StatusRuntimeException’s getTrailers() are now stabilized (#4697)

Behavior changes

  • Channel tracing:
    • Only logs when number of backends changed between zero and nonzero (#4666)
    • Now logs service config changes (#4675)
  • 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 if option deprecated = true is set from the proto file (#4741)

Acknowledgements

Thanks to all our external contributors:

v1.14.0

31 Jul 18:17
Compare
Choose a tag to compare

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 a EquivalentAddressGroup (EAG). This prevents the need for LoadBalancers to "flatten" a List<EquivalentAddressGroup> into a single EquivalentAddressGroup which loses/confuses the EAG's Attributes. NameResolvers can now specify Attributes in an EAG and expect that the values are passed to gRPC's core. Future work will add List<EAG> for OobChannels.
  • 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

26 Jul 22:35
Compare
Choose a tag to compare
  • Fix regression that broke Java 9 ALPN support. This fixes the error "SunJSSE selected, but Jetty NPN/ALPN unavailable" (#4620).

v1.12.1

26 Jul 22:34
Compare
Choose a tag to compare
  • Fix regression that broke Java 9 ALPN support. This fixes the error "SunJSSE selected, but Jetty NPN/ALPN unavailable" (#4620).

v1.13.1

21 Jun 16:24
Compare
Choose a tag to compare

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 has metadataMarshaller analogous to ProtoLiteUtils
  • Experimental jsonMarshaller has been removed from grpc-java library (and added into examples)
  • Added @CheckReturnValue annotation to AbstractStub, CallOptions, and Context
    • Special thanks: Grant Oakley
  • CallOptions API: Deprecated CallOptions.Key.of, added CallOptions.Key.create and CallOptions.Key.createWithDefault, and stabilized CallOptions.Key and CallOptions.withOption
  • Stabilized ManagedChannelBuilder.maxInboundMessageSize API

New features

  • Introduced JUnit test rule GrpcCleanupRule which is more flexible to use than GrpcServerRule
  • 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 for GoogleCredentials
  • core,stub: Added toString() to ClientCallImpl and GrpcFuture
    • 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 and ClientCall.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

09 May 00:15
Compare
Choose a tag to compare

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 for ServerBuilder.useTransportSecurity() and GrpcSslContexts.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 return true or call shutdownNow() 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). After DEFAULT_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 for StatusProto.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

30 Mar 23:15
Compare
Choose a tag to compare

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. Use usePlaintext(void) instead, which is equivalent to usePlaintext(true). usePlaintext(false) was almost always a bug, but is still available by specifying NegotiationType.PLAINTEXT_UPGRADE to NettyChannelBuilder
  • 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 a com.google.rpc.Status directly from a io.grpc.Status (instead of a Status*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 of onComplete(). 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 from GRPC_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

24 Mar 00:22
Compare
Choose a tag to compare

Bug fixes

  • netty: fix regression where using GRPC_PROXY_EXP with the Netty transport would cause an UnresolvedAddressException (#4178). ProxySelector (including the default one that processes -Dhttps.proxyHost) is still known-broken for Netty; this is tracked in #4029

v1.10.0

16 Feb 00:10
Compare
Choose a tag to compare

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:

  • netty: Use Java 9 ALPN if available (#3555). We still want to improve testing with Java 9 ALPN, but it has been reported to work.
  • cronet: add build support (#3965)
  • bazel: use same version libraries which gradle uses (#3911) (This upgrades Bazel to netty 4.1.17)

v1.9.1

12 Feb 18:57
Compare
Choose a tag to compare

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