Skip to content

Commit c84b4f9

Browse files
authored
Merge pull request #2245 from murgatroid99/grpc-js_consistent_max_memory_handling
grpc-js: Handle the grpc-node.max_session_memory option consistently on the client and server
2 parents 1ff7dca + 75a6d0a commit c84b4f9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

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)