Skip to content

Commit

Permalink
Merge pull request #2245 from murgatroid99/grpc-js_consistent_max_mem…
Browse files Browse the repository at this point in the history
…ory_handling

grpc-js: Handle the grpc-node.max_session_memory option consistently on the client and server
  • Loading branch information
murgatroid99 committed Oct 14, 2022
2 parents 1ff7dca + 75a6d0a commit c84b4f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/grpc-js/package.json
@@ -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
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 c84b4f9

Please sign in to comment.