Skip to content
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

Feature request: Show event loop context in the debugger #24549

Closed
puzpuzpuz opened this issue Nov 21, 2018 · 2 comments
Closed

Feature request: Show event loop context in the debugger #24549

puzpuzpuz opened this issue Nov 21, 2018 · 2 comments

Comments

@puzpuzpuz
Copy link
Member

Hi guys.

I wonder if there is a way to see the current event loop phase and microtasks queues (and other task queues too) during debugging a node application? I haven't found such stuff on the net, but maybe it's possible.

By that I mean being able to put a breakpoint somewhere in your code and see the diagnostic context of the event loop (and other related stuff like the worker thread pool) execution.

It may be useful in certain cases like the example that is described in the recent blog post from V8's team:

const p = Promise.resolve();

(async () => {
  await p;
  console.log('after:await');
})();

p.then(() => console.log('tick:a'))
  .then(() => console.log('tick:b'));

I know that this particular example is quite synthetic. But there are quite many real-world scenarios when being able to put a breakpoint somewhere in your code and see the context of the event loop (and other related stuff like the worker thread pool) execution would be very helpful.

As far as I undestand Node.js' code and internals, V8 and libuv are orchestrated by Node.js, so it's node's (or other runtime's) responsibility to provide this context to V8. And with this context V8 debugger would be able to output this data further down the debugging chain. For me it sounds like a cross-component feature that will require certain changes in Node.js and V8. But I'd like to have a confirmation from you, guys.

So, I wonder if it's somehow available in the node or V8 itself, or any 3rd-party library, or it's a brand new feature?

I've seen the issue #1128, but it's a bit different.

This is a question that I've already posted an issue on nodejs/help repo and was adviced to address the question to V8 team: nodejs/help#1621. Though I'm not sure if it's a question for V8 team only.

@gberdzenishvili
Copy link

+1 it will be very helpful

@devsnek
Copy link
Member

devsnek commented Nov 21, 2018

Duplicate of nodejs/help#1621

@devsnek devsnek marked this as a duplicate of nodejs/help#1621 Nov 21, 2018
@devsnek devsnek closed this as completed Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants