grpc/grpc-java
 Watch   
 Star   
 Fork   
9 days ago
grpc-java

V1.72.0

API Changes

  • util: Remove deprecated method GracefulSwitchLb.switchTo() (f207be39a). It is rarely used outside of gRPC. The configuration is passed as lb policy configuration instead
  • xds: Add support for custom per-target credentials on the transport (#11951) (1958e4237)
  • xds: Explicitly set request hash key for the ring hash LB policy (892144dca)

Bug Fixes

  • core: Apply ManagedChannelImpl's updateBalancingState() immediately (ca4819ac6)
  • xds: Fix cluster selection races when updating config selector (d82613a74)
  • otel: Fix span names as per the A72 gRFC changes (#11974) (94f8e9369)
  • xds: ClusterResolverLoadBalancer handle update for both resolved addresses and errors via ResolutionResult (#11997) (868178651)

Improvements

  • netty: Avoid allocating an exception on transport shutdown. This reduces allocation rate for connection-heavy workloads/load testing (a57c14a51)
  • servlet: Set an explicit description for CANCELLED status (#11927) (fca1d3cf4)
  • xds: gRFC A74 xDS Config Tears implementation in the XdsNameResolver (e80c19745). While there is more remaining, users may already see reduced latency when resources are replaced. For example, if changing a route from one backend service to another, RPCs may see less latency during the transition
  • core: Log any exception during channel panic because of exception (3961a923a). This prevents the exception from propagating up the stack on an arbitrary thread. Such exceptions are rarely interesting. Instead, the exception that caused the channel panic is the important one, and RPCs will still fail with its details
  • util: Graceful switch to new LB when leaving CONNECTING (2e260a4bb). Previously when using xDS and the configuration changes the LB policy, the old LB policy is used until the new one is READY. Now the old LB policy is used until the new policy becomes READY, TRANSIENT_FAILURE, or IDLE
  • core: Use java.time.Time.getNano directly in InstantTimeProvider. Previously reflection was used which would confuse R8 full mode (#11977) (7507a9ec0)
  • core: Avoid cancellation exceptions when notifying watchers that already have their connections cancelled (#11934) (350f90e1a)
  • rls: allow maxAge in RLS config to exceed 5 minutes if staleAge is set. Previously, the limit was 5 minutes, which isn't enough for some gRPC clients (#11931) (c340f4a2f)
  • xds: avoid unnecessary dns lookup for CIDR addresses (#11932) (602aece08)
  • netty: Swap to UniformStreamByteDistributor (#11954) (2f52a0036). gRPC will no longer observe the HTTP/2 priorities, which were not used directly by gRPC and deprecated in RFC 9113
  • core: Avoid Set.removeAll() when passing a possibly-large List (#11994) (666136b4b)
  • stub: trailersFromThrowable() metadata should be copied (#11979) (a6e1c1f09)

New Features

  • xds: xDS-based HTTP CONNECT configuration (#11861) (12197065f)
  • netty: Per-rpc authority verification against peer cert subject names. Overriding transport authority at rpc time is only allowed when using TlsChannelCredentials. The per-rpc authority verification feature is guarded by the environment variable GRPC_ENABLE_PER_RPC_AUTHORITY_CHECK in this release. When this is false or not set, the rpc will not fail when the authority verification fails but a warning will be logged. In a subsequent release the usage of this environment variable will be removed and RPCs will start failing if the authority doesn't match the peer certificate names. The environment variable is temporary; if you are depending on the existing insecure behavior, please file an issue (#11724) (cdab410b8)

Thanks to

@panchenko @emmanuel-ferdman @JoeCqupt

2025-03-04 22:23:22
grpc-java

V1.71.0

API Changes

  • xds: Enable Xds Client Fallback by default. This allows having a backup xDS server as described in gRFC A71-xds-fallback.md (#11817) (176f3eed1)
  • protobuf: Experimental API marshallerWithRecursionLimit in ProtoUtils is now stabilized (#11884) (90b1c4fe9)

Bug Fixes

  • xds: Cluster weights should be uint32 (199a7ea3e). They were previously processed as int32, although the sum of weights was checked to be positive. So this would have caused a very large weight to never be selected and to reduce the chances of immediately-following clusters to be selected. There have been no reports of control planes using such large weights
  • xds: Fix an unlikely infinite loop triggered by route update (199a7ea3e). Triggering required the old cluster to no longer be used, an RPC processing when the update arrived, and for a RPC to not match any route in the new config. There have been no reports of this actually happening
  • core: Release data frame if it is received before the headers (dc316f7fd)

Improvements

  • Replace jsr305's CheckReturnValue with Error Prone's (#11811) (7b5d0692c)
  • core: optimize number of buffer allocations for message sizes larger than 1 MB (#11879) (5a7f35053)
  • core: Update the retry backoff range from [0, 1] to [0.8, 1.2] as per the A6 redefinition (#11858) (44e92e2c2)
  • core: include last pick status in status message when wait-for-ready RPC’s deadline expires (#11851) (7585b1607). This makes it much easier to debug connectivity issues when using wait-for-ready RPCs
  • xds: Include max concurrent request limit in the error status for concurrent connections limit exceeded (#11845) (0f5503ebb)
  • netty, servlet: Remove 4096 min write buffer size because MessageFramer.flush() is being called between every message, so messages are never combined and the larger allocation just wastes memory. (4a10a3816, 7153ff852)
  • core: When ClientStreamObserver closes the response observer log the error message if this operation fails (#11880) (302342cfc)
  • bom: use gradle java-platform to build pom instead of custom xml generation (#11875) (3142928fa)
  • xds: Reuse filter interceptors on client-side across RPCs (c506190b0, b3db8c248). This was an internal refactor that should have no user-visible change
  • alts: Enhance AltsContextUtil to allow getting the AltsContext on client-side (b1bc0a9d2)
  • xds: Envoy proto sync to 2024-11-11 (#11816) (b44ebce45)

Documentation

  • examples: Update HelloWorldServer to use Executor (#11850) (16edf7ac4)
  • examples: Add README for all examples lacking it (#11676) (9e8629914)

Dependencies

  • Version upgrades (#11874) (fc8571a0e)
  • Upgrade netty-tcnative to 2.0.70 (122b68371)

Thanks to

@benjamin @panchenko @harshagoo94 @NaveenPrasannaV

2025-01-22 00:29:02
grpc-java

v1.70.0

Bug Fixes

  • Re-enable animalsniffer, fixing most violations (8ea362937). Violations would only have triggered on API level 23 and earlier, and the violations fixed here were highly unlikely to be triggered
  • api: Fix Android API level 23 and earlier compatibility for StatusRuntimeException without stacktrace (#11072) (ebe2b4867). This fixes a regression introduced in 1.64.0. The regression should have caused failures on API level 23 and earlier when a StatusRuntimeException or StatusException was created. However, for unknown reasons tests on old devices didn’t notice issues
  • okhttp: Improve certificate handling by rejecting non-ASCII subject alternative names and hostnames as seen in CVE-2021-0341 (#11749) (a0982ca0a). Hostnames are considered trusted and CAs are required to use punycode for non-ASCII hostnames, so this is expected to provide defense-in-depth. See also the related GoSecure blog post and the AOSP fix
  • okhttp: Fix for ipv6 link local with scope (#11725) (65b32e60e)
  • xds: Preserve nonce when unsubscribing last watcher of a particular type so that new discovery requests of that type are handled correctly (1cf1927d1). This (along with 6c12c2bd2) fixes a nonce-handling regression introduced in 1.66.0 that could cause resources to appear to not exist until re-creating the ADS stream. Triggering the behavior required specific config changes. It is easiest to trigger when clusters use EDS and routes are changed from one cluster to another. The error “found 0 leaf (logical DNS or EDS) clusters for root cluster” might then be seen
  • xds: Remember nonces for unknown types (6c12c2bd2)
  • xds: Unexpected types in the bootstrap’s server_features should be ignored (e8ff6da2c). They were previously required to be strings
  • xds: Remove xds authority label from metric registration (#11760) (6516c7387). This fixes the error “Incorrect number of required labels provided. Expected: 4” introduced in 1.69.0
  • xds: Fixed unsupported unsigned 32 bits issue for circuit breaker (#11735) (f8f613984). This fixes clients treating large max_requests as “no requests” and failing all requests

Improvements

  • api: Introduce custom NameResolver.Args (#11669) (0b2d44098)
  • stub: Introduce new API: BlockingStubV2 which supports Bidi streaming, Client streaming, a cleaner Server streaming and Unary RPCs (#10318) (ea8c31c30)
  • bazel: Remove workaround for DoNotCall fixed in Bazel 3.4 (805cad378)
  • binder: A standard API for pointing resolvers at a different Android User. (#11775) (1126a8e30)
  • xds: Fix XDS control plane client retry timer backoff duration when connection closes after results are received (#11766) (ef7c2d59c)
  • xds: Parsing xDS Cluster Metadata (#11741) (1edc4d84d). Not used actively, but this adds validation. The validation is unlikely to fail but may reject invalid resources.
  • xds: Use "#server" as dataplane target value for xDS enabled gRPC servers (#11715) (ebb43a69e). This only impacts the grpc.target label in grpc.xds_client.* metrics. Previously the empty string was used
  • rls: Reduce RLS debug channel logging (7f9c1f39f). This only matters when debug logging is enabled

Documentation

  • examples: Simplify graceful shutdown in Hostname example (f1109e421)
  • examples: Remove references to maven-central.storage-download.googleapis.com (c96e926e6)
  • examples: Updated the attachHeaders to newAttachHeadersInterceptor in HeaderClientInterceptor (#11759) (5e8abc677)

Dependencies

  • Bazel 8 is released, so replace Bazel 6 testing with Bazel 7 (8a5f7776d)

Thanks to

2025-01-16 23:46:06
grpc-java

v1.68.3

Bug Fixes

  • okhttp: Improve certificate handling by rejecting non-ASCII subject alternative names and hostnames as seen in CVE-2021-0341 (#11749) (a0982ca0a). Hostnames are considered trusted and CAs are required to use punycode for non-ASCII hostnames, so this is expected to provide defense-in-depth. See also the related GoSecure blog post and the AOSP fix
  • xds: Preserve nonce when unsubscribing last watcher of a particular type so that new discovery requests of that type are handled correctly (1cf1927d1). This (along with 1cf1927d1) fixes a nonce-handling regression introduced in 1.66.0 that could cause resources to appear to not exist until re-creating the ADS stream. Triggering the behavior required specific config changes. It is easiest to trigger when clusters use EDS and routes are changed from one cluster to another. The error “found 0 leaf (logical DNS or EDS) clusters for root cluster” might then be seen
  • xds: Remember nonces for unknown types (6c12c2bd2)
  • xds: Unexpected types in the bootstrap’s server_features should be ignored (e8ff6da2c). They were previously required to be strings
  • xds: Fixed unsupported unsigned 32 bits issue for circuit breaker (#11735) (f8f613984). This fixes clients treating large max_requests as “no requests” and failing all requests
2025-01-16 23:29:51
grpc-java

v1.69.1

Bug Fixes

  • okhttp: Improve certificate handling by rejecting non-ASCII subject alternative names and hostnames as seen in CVE-2021-0341 (#11749) (a0982ca0a). Hostnames are considered trusted and CAs are required to use punycode for non-ASCII hostnames, so this is expected to provide defense-in-depth. See also the related GoSecure blog post and the AOSP fix
  • xds: Preserve nonce when unsubscribing last watcher of a particular type so that new discovery requests of that type are handled correctly (1cf1927d1). This (along with 1cf1927d1) fixes a nonce-handling regression introduced in 1.66.0 that could cause resources to appear to not exist until re-creating the ADS stream. Triggering the behavior required specific config changes. It is easiest to trigger when clusters use EDS and routes are changed from one cluster to another. The error “found 0 leaf (logical DNS or EDS) clusters for root cluster” might then be seen
  • xds: Remember nonces for unknown types (6c12c2bd2)
  • xds: Unexpected types in the bootstrap’s server_features should be ignored (e8ff6da2c). They were previously required to be strings
  • xds: Fixed unsupported unsigned 32 bits issue for circuit breaker (#11735) (f8f613984). This fixes clients treating large max_requests as “no requests” and failing all requests
  • xds: Remove xds authority label from metric registration (#11760) (6516c7387). This fixes the error “Incorrect number of required labels provided. Expected: 4” introduced in 1.69.0
2024-12-10 00:39:45
grpc-java

v1.69.0

New Features api: Allow LoadBalancers to specify an authority per-RPC.(#11631) (c167ead85) CallOptions.withAuthority() has higher precedence. netty: Add soft Metadata size limit enforcement. (#11603) (735b3f3fe) The soft limit is a lower size limit that fails an increasing percentage of RPCs as the Metadata size approaches the upper limit. This can be used as an “early warning” that the Metadata size is growing too large alts: support altsCallCredentials in GoogleDefaultChannelCredentials (#11634) (ba8ab796e) xds: Add grpc.xds_client metrics, as documented by OpenTelemetry Metrics (#11661) (20d09cee5). grpc.xds.authority is not yet available

Bug Fixes api: When forwarding from Listener onAddresses to Listener2 continue to use onResult (#11666) (dae078c0a). This fixes a 1.68.1 "IllegalStateException: Not called from the SynchronizationContext" regression (#11662) that could be seen in certain custom NameResolvers okhttp: If the frame handler thread is null do not schedule it on the executor (ef1fe8737). This fixes a 1.68.1 NullPointerException regression when a custom transportExecutor was provided to the channel and it did not have enough threads to run new tasks

Improvements api: Add java.time.Duration overloads to CallOptions, AbstractStub methods that take TimeUnit and a time value (#11562) (766b92379) core: Make timestamp usage in Channelz use nanos from Java.time.Instant when available (#11604) (9176b5528). This increases the timestamp precision from milliseconds okhttp: Fix for ipv6 link local with scope (#11725) (e98e7445b) binder: Let AndroidComponentAddress specify a target UserHandle (#11670) (e58c998a4) servlet: Deframe failures should be logged on the server as warnings (#11645) (a5db67d0c) s2a: Rename the Bazel target s2av2_credentials to s2a (29dd9bad3). The target s2a had been referenced by IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS but didn’t previously exist services: Make channelz work with proto lite (#11685) (b1703345f). This compatibility is on the source level. There is not a pre-built binary on Maven Central that supports proto lite services: Deprecate ProtoReflectionService (#11681) (921f88ae3). The class implements the deprecated v1alpha of the reflection protocol. Prefer ProtoReflectionServiceV1, which implements the v1 version of the reflection protocol

Dependencies Upgrade proto-google-common-protos to 2.48.0 (1993e68b0) Upgrade google-auth-library to 1.24.1 (1993e68b0) Upgrade error_prone_annotations to 2.30.0 (1993e68b0) Upgrade Guava to 33.3.1-android (1993e68b0) Upgrade opentelemetry-api to 1.43.0 (1993e68b0) xds: Remove Bazel dependency on xds v2 (664f1fcf8). This had been done for the Maven Central binaries in 1.63.0, but had been missed for Bazel builds

Documentation binder: Update error codes doc for new "Safer Intent" rules. (#11639) (fe350cfd5) examples: Use xds-enabled server and xds credentials in example-gcp-csm-observability (#11706) (a79982c7f)

2024-11-28 08:08:05
grpc-java

v1.68.2

Bug Fixes

  • api: When forwarding from Listener onAddresses to Listener2 continue to use onResult (https://github.com/grpc/grpc-java/pull/11688). This fixes a 1.68.1 "IllegalStateException: Not called from the SynchronizationContext" regression (#11662) that could be seen in certain custom NameResolvers
  • okhttp: If the frame handler thread is null do not schedule it on the executor (https://github.com/grpc/grpc-java/pull/11716). This fixes a 1.68.1 NullPointerException regression when a custom transportExecutor was provided to the channel and it did not have enough threads to run new tasks

Improvements

2024-10-29 07:22:13
grpc-java

v1.68.1

gRPC Java 1.68.1 Release Notes

v1.68.0 was a mistake. This is the first release of version 1.68.x

Bug Fixes

  • xds: Fix NullPointerException introduced in "Fix load reporting when pick first is used for locality-routing" (#11553). This was in 1.67.1 but not 1.68.0

Behavior Changes

  • core: JSON parsing rejects duplicate keys in objects (#11575) (4be69e3f8). This is the existing behavior in C core. Duplicate keys in objects are dangerous as which value takes effect is undefined. Previously, the last value was used
  • okhttp: Detect transport executors with no remaining threads (#11503) (3a6be9ca1). The transport uses two threads, but one is on-demand. If the executor provided to builder.transportExecutor() runs out of threads (e.g., it is a fixed-size thread pool), all transports can be wedged, unable to run on-demand tasks, until keepalive kills one of them. Two threads are now used when handshaking a new transport, and the transport will time out after 1 second with “Timed out waiting for second handshake thread” if two threads are unavailable
  • gcp-csm-o11y: Get mesh_id value from CSM_MESH_ID environment variable, instead of getting it from bootstrap file (84d30afad)

Improvements

  • New grpc-context-override-opentelemetry artifact (#11523) (782a44ad6) (#11599) (e59ae5fad). This is a io.grpc.Context storage override to store its state in io.opentelemetry.context.Context. Libraries should not add a dependency on this artifact, as applications can only have one storage override in their classpath
  • New grpc-s2a artifact. It is a transport that offloads the handshake similar to ALTS, but for TLS. It provides io.grpc.s2a.S2AChannelCredentials
  • api: Enhance name resolver `ResolutionResult` to hold addresses or error so the single listener API onResult2 is used to convey both success and error cases for name resolution (#11330) (1ded8aff8)
  • core: Handle NameResolver/LoadBalancer exceptions when panicking (b692b9d26). This expands the class of bugs that will fail RPCs with the panic error, versus some undefined behavior
  • core: Use the default service config in case of initial name resolver address resolution error (#11577) (fa26a8bc5)
  • core: StreamTracer.inboundMessageRead() now reports uncompressed message size when the message does not need compression (#11598) (2aae68e11). Previously it always reported -1 (unknown)
  • netty: Avoid TCP_USER_TIMEOUT warning when explicitly specifying a non-epoll channel type to use (#11564) (62f409810)
  • okhttp: Don't warn about missing Conscrypt (6f3542297). This is especially helpful when using TLS but not running on Android
  • android: For UdsChannelBuilder, use fake IP instead of localhost (a908b5e40). This avoids an unnecessary DNS lookup
  • xds: Add xDS node ID in select control plane errors to enable cross-referencing with control plane logs when debugging (f3cf7c3c7)
  • xds: Enhanced how ADS stream terminations are handled, specifically addressing cases where a response has or hasn't been received (#2e9c3e19f)
  • binder: Update status code documentation for Android 11's package visibility rules. (#11551) (99be6e985)
  • binder: Update binderDied() error description to spell out the possibilities for those unfamiliar with Android internals. (#11628) (46c1b387f)
  • example-gauth: Use application default creds instead of file argument (#11595) (94a0a0d1c)

Dependencies

  • Updated protobuf-java to 3.25.5. This helps avoid CVE-2024-7254 (2ff837ab6)

Thanks to:
@Juneezee
@lgalfaso
@bestbeforetoday
@hlx502
@JoeCqupt

2024-09-26 17:06:01
grpc-java

v1.67.1

gRPC Java 1.67.1 Release Notes

API Changes

xds: Stop extending RoundRobin in WeightedRoundRobin (dc83446d9) xds: Remove ExperimentalApi for WeightedRoundRobin LB as it is already package private. (0d2ad8901)

Improvements

Introduce onResult2 in NameResolver Listener2 that returns Status (90d0fabb1) xds: Add test that uses real DnsNR with ClusterResolverLB (9bc1a93f6) android-interop-testing: Enable -Xlint:deprecation (b8e3ae9a4) api: Move ClientStreamTracerTest from core to api (780e4ba08) core: Don't reuse channels in PickFirstLeafLB test (e567b4427) core: In PickFirst LB, pass around SubchannelData instead of Subchannel (15456f8f0) CONTRIBUTING.md: Update commit guidelines (18d73a368) util: SocketAddress.toString() cannot be used for equality (f866c805c) util: Delete unused MultiChildLB.ChildLbState.getSubchannels() (2f4f7f0ec) xds: Replace WrrHelper with a per-child Helper (d1dcfb045) xds: WRRPicker must not access unsynchronized data in ChildLbState (0d47f5bd1) netty: Use DefaultELG with LocalChannel in test because LocalChannel is not guaranteed to be compatible with NioEventLoopGroup (4ab34229f) util: Remove implicit requestConnection() on IDLE from MultiChildLB (a6f8ebf33) util: MultiChildLb children should always start with a NoResult picker (b5989a540) xds: Delegate more RingHashLB address updates to MultiChildLB (fd8734f34) cronet: Add internal API to specify Network (c2eccca3b) interop-testing: Add dualstack interop test kokoro config (#11422) (941a1c37a) example: Dualstack example (#11451) (72a977bf7) xds: Separate xds clients for each authority, each with its own connection to an xds server. (#11484) (d034a56cb) rls: Fix log statements incorrectly referring to "LRS" (#11497) (c63e35488) xds: Envoy proto sync to 2024-07-06 (#11401) (96a788a34) xds: cncf/xds proto sync to 2024-07-24 (#11417) (0017c98f6) xds: Import RLQS protos (#11418) (c29763d88) core: Make once-set fields of AbstractClientStream as final(#11389) (40e2b165b) opentelemetry: add binary format, grpcTraceBinContextPropagator (#11409) (043ba556b) opentelemetry: add OpenTelemetryTracingModule (#11477) (421e2371e) example: delete duplicate and unused code in KeepAliveClient.java (6a9bc3ba1) util: Remove minor convenience functions from MultiChildLB (909c4bc38) core: PickFirstLeafLoadBalancer Index.size() should be number of addresses (c120e364d) util: Remove MultiChildLB.getImmutableChildMap() (778a00b62) core: Never have null PickFirstLeafLoadBalancer Index (8bd97953a) core: Remove useless NPE check for syncContext in PF (33687d398) core: Avoid exception handling in PF for invalid index (4914ffc59) core: PF.requestConnection() is possible when READY (2c93791c9) core: In PF, remove useless requestConnection for CONNECTING subchannel (82a8d5739) core: In PF, remove extraneous index.reset() (9762945f8) interop-testing: Move interop tests only used by test client to the test client (6c9f92a72) util: Replace RoundRobinLoadBalancer.EmptyPicker with FixedResultPicker (f20167d60) core: In PF, disjoint update while READY should transition to IDLE (ee3ffef3e) xds: ClusterManagerLB must update child configuration (10d6002cb) util: Remove child policy config from MultiChildLB state (01389774d) util: MultiChildLB children know if they are active (4cb646519) util: Focus MultiChildLB updates around ResolvedAddresses of children (cfecc4754) core: touch() buffer when detach()ing (e821d5e15) xds: XdsClient should unsubscribe on last resource (#11264) (448ec4f37) stub: Add newAttachMetadataServerInterceptor() MetadataUtil (#11458) (6dbd1b9d5)

Bug Fixes

xds: Fix load reporting when pick first is used for locality-routing. (#11495) (1dae144f0) core: Revert "Enable new PickFirst LB (#11348)" (#11425) (cc1cbe987)

Dependencies

.github/workflows: Bump action major versions from Node16 to Node20 (#11476) (66075eab8) interop-testing: Remove unused implementation deps (1f9d50226) Revert "Netty upgrade to 4.1.110 in grpc-java (#11273)" (9bed655c5) Netty upgrade to 4.1.110 in grpc-java (#11273) (f9b072cfe) Upgrade Netty to 4.1.110 and tcnative to 2.0.65 (#11444) (70ae83288) Migrate from the deprecated Charsets constants (in Guava) to the StandardCharsets constants (in the JDK). (00136096e) Migrate from the deprecated Charsets constants (in Guava) to the StandardCharsets constants (in the JDK) (06135a074) Migrate from Charsets to StandardCharsets. (#11482) (2fe1a13cd) examples: Upgrade Maven plugin versions (75012a5be) Remove direct dependency on j2objc (ff8e41376)

Thanks to

Eng Zer Jun engzerjun@gmail.com Jiajing LU lujiajing1126@gmail.com Petr Portnov | PROgrm_JARvis mrJARVIScraft@gmail.com sunpe sunpeng.dev@gmail.com

2024-09-17 17:11:26
grpc-java

v1.68.0 MISTAKE

This was supposed to be v1.67.0, but there was a mistake during the release process. This has everything in v1.67.1, except for: