From 9691f0eb0e35aba6acbab6e1ab7ed9a294776d12 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Mon, 3 Mar 2025 15:58:43 -0800 Subject: [PATCH 1/2] grpc-js: Update to 1.13.0 --- packages/grpc-js-xds/README.md | 3 ++- packages/grpc-js-xds/package.json | 4 ++-- packages/grpc-js/package.json | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/grpc-js-xds/README.md b/packages/grpc-js-xds/README.md index 48a4db10f..bab5a588f 100644 --- a/packages/grpc-js-xds/README.md +++ b/packages/grpc-js-xds/README.md @@ -1,6 +1,6 @@ # @grpc/grpc-js xDS plugin -This package provides support for the `xds://` URL scheme to the `@grpc/grpc-js` library. The latest version of this package is compatible with `@grpc/grpc-js` version 1.10.x. +This package provides support for the `xds://` URL scheme to the `@grpc/grpc-js` library. The latest version of this package is compatible with `@grpc/grpc-js` version 1.13.x. ## Installation @@ -36,3 +36,4 @@ const client = new MyServiceClient('xds:///example.com:123'); - [xDS Ring Hash LB Policy](https://github.com/grpc/proposal/blob/master/A42-xds-ring-hash-lb-policy.md) - [`pick_first` via xDS](https://github.com/grpc/proposal/blob/master/A62-pick-first.md#pick_first-via-xds-1) (Currently experimental, enabled by environment variable `GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG`) - [xDS-Enabled Servers](https://github.com/grpc/proposal/blob/master/A36-xds-for-servers.md) + - [xDS-Based Security for gRPC Clients and Servers](https://github.com/grpc/proposal/blob/master/A29-xds-tls-security.md) diff --git a/packages/grpc-js-xds/package.json b/packages/grpc-js-xds/package.json index c93e1a4c6..805126130 100644 --- a/packages/grpc-js-xds/package.json +++ b/packages/grpc-js-xds/package.json @@ -1,6 +1,6 @@ { "name": "@grpc/grpc-js-xds", - "version": "1.12.2", + "version": "1.13.0", "description": "Plugin for @grpc/grpc-js. Adds the xds:// URL scheme and associated features.", "main": "build/src/index.js", "scripts": { @@ -55,7 +55,7 @@ "xxhash-wasm": "^1.0.2" }, "peerDependencies": { - "@grpc/grpc-js": "~1.12.0" + "@grpc/grpc-js": "~1.13.0" }, "engines": { "node": ">=10.10.0" diff --git a/packages/grpc-js/package.json b/packages/grpc-js/package.json index b54b1a8da..b2dc54209 100644 --- a/packages/grpc-js/package.json +++ b/packages/grpc-js/package.json @@ -1,6 +1,6 @@ { "name": "@grpc/grpc-js", - "version": "1.12.6", + "version": "1.13.0", "description": "gRPC Library for Node - pure JS implementation", "homepage": "https://grpc.io/", "repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js", From abcf4306d6646cb5bd76e38ae1a5d2e880f66b06 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Tue, 4 Mar 2025 14:44:57 -0800 Subject: [PATCH 2/2] grpc-js-xds: ring_hash: Fix proactive connect logic when already connecting --- packages/grpc-js-xds/src/load-balancer-ring-hash.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/grpc-js-xds/src/load-balancer-ring-hash.ts b/packages/grpc-js-xds/src/load-balancer-ring-hash.ts index 299ced7a8..af3ebac86 100644 --- a/packages/grpc-js-xds/src/load-balancer-ring-hash.ts +++ b/packages/grpc-js-xds/src/load-balancer-ring-hash.ts @@ -249,16 +249,20 @@ class RingHashLoadBalancer implements LoadBalancer { if (!(this.currentState === connectivityState.TRANSIENT_FAILURE || this.currentState === connectivityState.CONNECTING)) { return; } + let firstIdleChild: LeafLoadBalancer | null = null; for (const leaf of this.leafMap.values()) { const leafState = leaf.getConnectivityState(); if (leafState === connectivityState.CONNECTING) { + firstIdleChild = null; break; } - if (leafState === connectivityState.IDLE) { - leaf.startConnecting(); - break; + if (leafState === connectivityState.IDLE && !firstIdleChild) { + firstIdleChild = leaf; } } + if (firstIdleChild) { + firstIdleChild.startConnecting(); + } } private calculateAndUpdateState() {