-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async stack tracking should not be enabled by default #16180
Comments
@ofrobots good points. IIRC, DevTools have a checkbox to enable/disable async stack traces in the debugger. Under the hood, DevTools send So I think the only overhead of enabling async stack traces lies in the overhead of Node.js's async_hooks machinery, which is still likely to change the performance profile of the inspected app as you pointed out. I think it would be best if Node.js could intercept Thoughts? |
That would be amazing. But we need to read the |
Interception is totally possible. Reading it at startup isn't as big of a concern, since right now we allow enabling inspection during runtime and tasks started before starting inspection are not tracked anyway. |
@refack Thanks for the heads up. |
@prigara The OP mentions a few cases other than heap profiler (e.g. CPU profiling, passive debugging). IMO, it is not an option to keep by-default stack tracking. I would like to get this fixed before we reach LTS for Node 8.x. I'm looking into intercepting |
Interception of the With |
@prigara with the hooks enabled, the debugger steps into the hooks scripts for all of the invocations (before and after async operations), and when stepping through the hook invocation script makes the async stack suddenly appear @ofrobots I might be wrong, but I think that if the inspector Agent will send |
PR: #16260 |
With this change, we do async stack tracking only when explicitly requested by the inspector client. This avoids unnecessary overhead for clients that might not be interested in async stack traces. Fixes: nodejs#16180
With this change, we do async stack tracking only when explicitly requested by the inspector client. This avoids unnecessary overhead for clients that might not be interested in async stack traces. PR-URL: nodejs#16308 Fixes: nodejs#16180 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
With this change, we do async stack tracking only when explicitly requested by the inspector client. This avoids unnecessary overhead for clients that might not be interested in async stack traces. PR-URL: nodejs#16308 Fixes: nodejs#16180 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
With this change, we do async stack tracking only when explicitly requested by the inspector client. This avoids unnecessary overhead for clients that might not be interested in async stack traces. Backport-PR-URL: #16590 PR-URL: #16308 Fixes: #16180 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
With this change, we do async stack tracking only when explicitly requested by the inspector client. This avoids unnecessary overhead for clients that might not be interested in async stack traces. PR-URL: nodejs/node#16308 Fixes: nodejs/node#16180 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
With this change, we do async stack tracking only when explicitly requested by the inspector client. This avoids unnecessary overhead for clients that might not be interested in async stack traces. PR-URL: nodejs/node#16308 Fixes: nodejs/node#16180 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
With this change, we do async stack tracking only when explicitly requested by the inspector client. This avoids unnecessary overhead for clients that might not be interested in async stack traces. PR-URL: nodejs/node#16308 Fixes: nodejs/node#16180 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
excuse me, but i am facing the same error recently when i was trying to inspect/debug my NodeJS Code...
what about that Node.JS version: |
#13870 adds support for async stack tracking whenever the inspector agent is enabled. Async stack traces are awesome for debugging, but doing this by automatically when the inspector agent is active has a lot of problems:
Some problematic scenarios I can think of:
Async stack tracking should have been an opt in. Whether or not the inspector agent is enabled conflates too many use-cases.
Apologies that I didn't catch this issue earlier.
/cc @nodejs/v8-inspector @bajtos @nodejs/diagnostics
The text was updated successfully, but these errors were encountered: