Compare commits

...

7 Commits

Author SHA1 Message Date
Michael Lumish
bf0dc8fb72
Merge pull request #3029 from murgatroid99/grpc-js_keepalive_fix_backport
Backport "Fix server keep alive timeout not properly destroying connections" to 1.14.x
2025-12-02 07:08:01 -08:00
Michael Lumish
235474ef4a grpc-js: Bump to 1.14.2 2025-12-01 12:03:35 -05:00
Mattias Wiberg
2f090c62a6 grpc-js: Fix server keep alive timeout not properly destroying connections 2025-12-01 12:02:37 -05:00
Michael Lumish
425e7cb83c
Merge pull request #3023 from murgatroid99/grpc-js_session_memory_fix
grpc-js: Re-add a couple of accidentally removed HTTP/2 session settings
2025-11-07 12:33:41 -08:00
Michael Lumish
dcb2182c23 grpc-js: Re-add a couple of accidentally removed HTTP/2 session settings 2025-11-04 11:23:06 -08:00
Michael Lumish
3dd281b00f
Merge pull request #3014 from murgatroid99/grpc-js_v1.14_bump
grpc-js(-xds): Bump to 1.14.0 and update README
2025-09-15 13:28:41 -07:00
Michael Lumish
26c5fe4fd5 grpc-js(-xds): Bump to 1.14.0 and update README 2025-09-12 15:43:04 -07:00
5 changed files with 19 additions and 11 deletions

View File

@ -31,9 +31,11 @@ const client = new MyServiceClient('xds:///example.com:123');
- [Outlier Detection](https://github.com/grpc/proposal/blob/master/A50-xds-outlier-detection.md) - [Outlier Detection](https://github.com/grpc/proposal/blob/master/A50-xds-outlier-detection.md)
- [xDS Retry Support](https://github.com/grpc/proposal/blob/master/A44-xds-retry.md) - [xDS Retry Support](https://github.com/grpc/proposal/blob/master/A44-xds-retry.md)
- [xDS Aggregate and Logical DNS Clusters](https://github.com/grpc/proposal/blob/master/A37-xds-aggregate-and-logical-dns-clusters.md) - [xDS Aggregate and Logical DNS Clusters](https://github.com/grpc/proposal/blob/master/A37-xds-aggregate-and-logical-dns-clusters.md)
- [xDS Federation](https://github.com/grpc/proposal/blob/master/A47-xds-federation.md) (Currently experimental, enabled by environment variable `GRPC_EXPERIMENTAL_XDS_FEDERATION`) - [xDS Federation](https://github.com/grpc/proposal/blob/master/A47-xds-federation.md)
- [xDS Custom Load Balancer Configuration](https://github.com/grpc/proposal/blob/master/A52-xds-custom-lb-policies.md) (Custom load balancer registration not currently supported) - [xDS Custom Load Balancer Configuration](https://github.com/grpc/proposal/blob/master/A52-xds-custom-lb-policies.md) (Custom load balancer registration not currently supported)
- [xDS Ring Hash LB Policy](https://github.com/grpc/proposal/blob/master/A42-xds-ring-hash-lb-policy.md) - [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`) - [`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-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) - [xDS-Based Security for gRPC Clients and Servers](https://github.com/grpc/proposal/blob/master/A29-xds-tls-security.md)
- [xDS RBAC Support](https://github.com/grpc/proposal/blob/master/A41-xds-rbac.md)
- [`weighted_round_robin` LB policy](https://github.com/grpc/proposal/blob/master/A58-client-side-weighted-round-robin-lb-policy.md) (Inclusion in xDS registry is currently experimental, enabled by environment variable `GRPC_EXPERIMENTAL_XDS_WRR_LB`)

View File

@ -1,6 +1,6 @@
{ {
"name": "@grpc/grpc-js-xds", "name": "@grpc/grpc-js-xds",
"version": "1.13.0", "version": "1.14.0",
"description": "Plugin for @grpc/grpc-js. Adds the xds:// URL scheme and associated features.", "description": "Plugin for @grpc/grpc-js. Adds the xds:// URL scheme and associated features.",
"main": "build/src/index.js", "main": "build/src/index.js",
"scripts": { "scripts": {
@ -55,7 +55,7 @@
"xxhash-wasm": "^1.0.2" "xxhash-wasm": "^1.0.2"
}, },
"peerDependencies": { "peerDependencies": {
"@grpc/grpc-js": "~1.13.0" "@grpc/grpc-js": "~1.14.0"
}, },
"engines": { "engines": {
"node": ">=10.10.0" "node": ">=10.10.0"

View File

@ -1,6 +1,6 @@
{ {
"name": "@grpc/grpc-js", "name": "@grpc/grpc-js",
"version": "1.13.4", "version": "1.14.2",
"description": "gRPC Library for Node - pure JS implementation", "description": "gRPC Library for Node - pure JS implementation",
"homepage": "https://grpc.io/", "homepage": "https://grpc.io/",
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js", "repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",

View File

@ -1609,7 +1609,7 @@ export class Server {
if (err) { if (err) {
this.keepaliveTrace('Ping failed with error: ' + err.message); this.keepaliveTrace('Ping failed with error: ' + err.message);
sessionClosedByServer = true; sessionClosedByServer = true;
session.close(); session.destroy();
} else { } else {
this.keepaliveTrace('Received ping response'); this.keepaliveTrace('Received ping response');
maybeStartKeepalivePingTimer(); maybeStartKeepalivePingTimer();
@ -1631,7 +1631,7 @@ export class Server {
'Connection dropped due to ping send error: ' + pingSendError 'Connection dropped due to ping send error: ' + pingSendError
); );
sessionClosedByServer = true; sessionClosedByServer = true;
session.close(); session.destroy();
return; return;
} }
@ -1640,7 +1640,7 @@ export class Server {
this.keepaliveTrace('Ping timeout passed without response'); this.keepaliveTrace('Ping timeout passed without response');
this.trace('Connection dropped by keepalive timeout'); this.trace('Connection dropped by keepalive timeout');
sessionClosedByServer = true; sessionClosedByServer = true;
session.close(); session.destroy();
}, this.keepaliveTimeoutMs); }, this.keepaliveTimeoutMs);
keepaliveTimer.unref?.(); keepaliveTimer.unref?.();
}; };
@ -1803,7 +1803,7 @@ export class Server {
duration duration
); );
sessionClosedByServer = true; sessionClosedByServer = true;
session.close(); session.destroy();
} else { } else {
this.keepaliveTrace('Received ping response'); this.keepaliveTrace('Received ping response');
maybeStartKeepalivePingTimer(); maybeStartKeepalivePingTimer();
@ -1826,7 +1826,7 @@ export class Server {
'Connection dropped due to ping send error: ' + pingSendError 'Connection dropped due to ping send error: ' + pingSendError
); );
sessionClosedByServer = true; sessionClosedByServer = true;
session.close(); session.destroy();
return; return;
} }
@ -1840,7 +1840,7 @@ export class Server {
'Connection dropped by keepalive timeout from ' + clientAddress 'Connection dropped by keepalive timeout from ' + clientAddress
); );
sessionClosedByServer = true; sessionClosedByServer = true;
session.close(); session.destroy();
}, this.keepaliveTimeoutMs); }, this.keepaliveTimeoutMs);
keepaliveTimeout.unref?.(); keepaliveTimeout.unref?.();
}; };

View File

@ -720,7 +720,13 @@ export class Http2SubchannelConnector implements SubchannelConnector {
initialWindowSize: initialWindowSize:
options['grpc-node.flow_control_window'] ?? options['grpc-node.flow_control_window'] ??
http2.getDefaultSettings?.()?.initialWindowSize ?? 65535, http2.getDefaultSettings?.()?.initialWindowSize ?? 65535,
} },
maxSendHeaderBlockLength: Number.MAX_SAFE_INTEGER,
/* By default, set a very large max session memory limit, to effectively
* disable enforcement of the limit. Some testing indicates that Node's
* behavior degrades badly when this limit is reached, so we solve that
* by disabling the check entirely. */
maxSessionMemory: options['grpc-node.max_session_memory'] ?? Number.MAX_SAFE_INTEGER
}; };
const session = http2.connect(`${scheme}://${targetPath}`, sessionOptions); const session = http2.connect(`${scheme}://${targetPath}`, sessionOptions);
// Prepare window size configuration for remoteSettings handler // Prepare window size configuration for remoteSettings handler