-
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
Long stack traces in core #31080
Comments
I'm not sure what that would entail. Also - do you mean for things other than async functions? I was under the impression that we already do have long stack traces in core (for async functions) with --async-stack-traces |
I am obviously a big +1 on anything that makes debugging async code easier :) |
@benjamingr I’m talking about any async resources, not just async functions here :) So including nextTicks, timers, etc. |
I'm +1 on the idea in general.
I'd be OK with that if the vendored module behaved like any other core module. For example, when we added rimraf support, the userland module didn't really have the same developer experience, mostly around things like option names and error handling. |
sorry for asking a basic question: what is a long stack trace? a simulated chain of stack traces that belong to one logical call unit but were never available together in the thread stack due to the presences of async calls? or is it something else? |
@gireeshpunathil Yes, exactly. |
I guess the confusion comes from that the concept is usually referred to as "async stack trace"? (e.g. the |
@joyeecheung Not always – I’m thinking that this would be enabled through e.g. a command line flag. |
@addaleax I see. I would be inclined to maintaining this in core instead of vendoring in one in considering we already have an implementation in Node.js core for the inspector. We could essentially just refactor that code so that it reports to something that can be fetched by e.g. our stack trace preparation callback. (this again brings up the issue about making it play along with user-land |
I, personally, would be consider a solution along the lines of #30984 to be perfect (e.g. adding |
@addaleax @joyeecheung just seeing this. I liked @joyeecheung's suggestion of potentially adding an additional parameter to Perhaps we could hammer out a little RFC document for this proposal? |
@bcoe To clarify I was just suggesting fetching the information in our internal stack trace preparation callback, which calls the user-land |
It also should have an option to return stack trace only for userland code. |
I think this was partially solved in latests V8 with long stack traces with async functions, I'm going to close this. |
What about |
With all the work currently being done around async_hooks and stack trace enhancement through e.g. source maps, I’m wondering whether we should bring official long stack trace support into core.
I’d personally love to see it – I’m certainly biased, but for debugging flaky tests alone it would make things a lot easier to not to have to pull in an external utility for that (or to have to write an ad-hoc one).
Alternatives would be to keep these utilities in userland and/or to just vendor one in but keep developing it outside of core. In particular the latter also seems good to me.
@nodejs/async_hooks @bcoe @AndreasMadsen
The text was updated successfully, but these errors were encountered: