Skip to content

Commit

Permalink
Merge pull request #2248 from grpc/@grpc/grpc-js@1.7.x
Browse files Browse the repository at this point in the history
Merge v1.7.x into master
  • Loading branch information
murgatroid99 committed Oct 14, 2022
2 parents f3fc8dc + c84b4f9 commit aaa568f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/grpc-js-xds/src/xds-stream-state/eds-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import { BaseXdsStreamState, HandleResponseResult, RejectedResourceEntry, Resour

const TRACER_NAME = 'xds_client';

const UINT32_MAX = 0xFFFFFFFF;

function trace(text: string): void {
experimental.trace(logVerbosity.DEBUG, TRACER_NAME, text);
}
Expand Down Expand Up @@ -88,7 +90,7 @@ export class EdsState extends BaseXdsStreamState<ClusterLoadAssignment__Output>
priorityTotalWeights.set(endpoint.priority, (priorityTotalWeights.get(endpoint.priority) ?? 0) + (endpoint.load_balancing_weight?.value ?? 0));
}
for (const totalWeight of priorityTotalWeights.values()) {
if (totalWeight >= 1<<32) {
if (totalWeight > UINT32_MAX) {
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/grpc-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@grpc/grpc-js",
"version": "1.7.1",
"version": "1.7.2",
"description": "gRPC Library for Node - pure JS implementation",
"homepage": "https://grpc.io/",
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
Expand Down
6 changes: 6 additions & 0 deletions packages/grpc-js/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,12 @@ export class Server {
serverOptions.maxSessionMemory = this.options[
'grpc-node.max_session_memory'
];
} else {
/* 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. */
serverOptions.maxSessionMemory = Number.MAX_SAFE_INTEGER;
}
if ('grpc.max_concurrent_streams' in this.options) {
serverOptions.settings = {
Expand Down

0 comments on commit aaa568f

Please sign in to comment.