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

How to Debug Multiple Instances in Node.js Embedded Development #4475

Open
2 tasks done
sagasarate opened this issue Sep 2, 2024 · 0 comments
Open
2 tasks done

How to Debug Multiple Instances in Node.js Embedded Development #4475

sagasarate opened this issue Sep 2, 2024 · 0 comments
Labels

Comments

@sagasarate
Copy link

Node.js Version

v23.0.0-pre

NPM Version

10.6.0

Operating System

windows

Subsystem

Other

Description

I am using node::CommonEnvironmentSetup::Create to create multiple JS virtual machine instances, each running in a different thread. However, I'm encountering difficulties with debugging.

Node.js seems to only allow a single inspector instance. If I pass kOwnsInspector (or kDefaultFlags) for each CommonEnvironmentSetup::Create, the second CommonEnvironmentSetup::Create call throws an exception, which seems to be due to an IO thread initialization conflict.

If only the first CommonEnvironmentSetup::Create has kOwnsInspector, subsequent calls to CommonEnvironmentSetup::Create fail to create an inspector because they attempt to use the same listening port. I have not found any public API that allows modifying the listening port.

Lastly, I experimented with passing a parent_handle, but it seems that the debugger cannot reach the non-primary instances during debugging.

Is there a way to debug multiple JS virtual machine instances running in different threads?

Minimal Reproduction

No response

Output

No response

Before You Submit

  • I have looked for issues that already exist before submitting this
  • My issue follows the guidelines in the README file, and follows the 'How to ask a good question' guide at https://stackoverflow.com/help/how-to-ask
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants