Skip to content

Commit aaa568f

Browse files
authored
Merge pull request #2248 from grpc/@grpc/[email protected]
Merge v1.7.x into master
2 parents f3fc8dc + c84b4f9 commit aaa568f

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

packages/grpc-js-xds/src/xds-stream-state/eds-state.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import { BaseXdsStreamState, HandleResponseResult, RejectedResourceEntry, Resour
2525

2626
const TRACER_NAME = 'xds_client';
2727

28+
const UINT32_MAX = 0xFFFFFFFF;
29+
2830
function trace(text: string): void {
2931
experimental.trace(logVerbosity.DEBUG, TRACER_NAME, text);
3032
}
@@ -88,7 +90,7 @@ export class EdsState extends BaseXdsStreamState<ClusterLoadAssignment__Output>
8890
priorityTotalWeights.set(endpoint.priority, (priorityTotalWeights.get(endpoint.priority) ?? 0) + (endpoint.load_balancing_weight?.value ?? 0));
8991
}
9092
for (const totalWeight of priorityTotalWeights.values()) {
91-
if (totalWeight >= 1<<32) {
93+
if (totalWeight > UINT32_MAX) {
9294
return false;
9395
}
9496
}

packages/grpc-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@grpc/grpc-js",
3-
"version": "1.7.1",
3+
"version": "1.7.2",
44
"description": "gRPC Library for Node - pure JS implementation",
55
"homepage": "https://grpc.io/",
66
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",

packages/grpc-js/src/server.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,12 @@ export class Server {
346346
serverOptions.maxSessionMemory = this.options[
347347
'grpc-node.max_session_memory'
348348
];
349+
} else {
350+
/* By default, set a very large max session memory limit, to effectively
351+
* disable enforcement of the limit. Some testing indicates that Node's
352+
* behavior degrades badly when this limit is reached, so we solve that
353+
* by disabling the check entirely. */
354+
serverOptions.maxSessionMemory = Number.MAX_SAFE_INTEGER;
349355
}
350356
if ('grpc.max_concurrent_streams' in this.options) {
351357
serverOptions.settings = {

0 commit comments

Comments
 (0)