Conversation
Currently, Client constructs a new Error on every RPC invocation to capture the caller's stack trace in case the call fails. Constructing an Error captures a full V8 stack trace synchronously on every call, which adds noticeable CPU and GC overhead in high-throughput applications. This adds a channel option `grpc.enable_caller_stack_traces` (enabled by default) that allows clients to opt out of caller stack trace capture. When disabled, the client omits caller stack frame capture during call dispatch, reducing per-RPC overhead. The default behavior of the gRPC client remains unchanged by this PR.
| * stack trace. Enabled by default (1). Can be set to 0 to disable and avoid | ||
| * stack trace capture overhead for every RPC. | ||
| */ | ||
| 'grpc.enable_caller_stack_traces'?: number; |
Member
There was a problem hiding this comment.
For consistency with other channel options that are specific to this implementation, and have no reason to ever be shared with the C++ implementation, this option name should be grpc-node.enable_caller_stack_traces.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, Client constructs a new Error on every RPC invocation to capture the caller's stack trace in case the call fails. Constructing an Error captures a full V8 stack trace synchronously on every call, which adds noticeable CPU and GC overhead in high-throughput applications.
This adds a channel option
grpc.enable_caller_stack_traces(enabled by default) that allows clients to opt out of caller stack trace capture. When disabled, the client omits caller stack frame capture during call dispatch, reducing per-RPC overhead.The default behavior of the gRPC client remains unchanged by this PR.