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

inspector.open(0, undefined, /* wait */true) won't allow communicating inspector.url() #28663

Open
pavelfeldman opened this issue Jul 13, 2019 · 5 comments
Labels
inspector Issues and PRs related to the V8 inspector protocol

Comments

@pavelfeldman
Copy link
Contributor

I'd like to open the first available debugging port and wait for client to attach before I continue execution, so I do:

inspector.open(0, undefined, /* wait */ true);

This results in a logical deadlock though: in order to get the inspector.url(), I need to continue execution. But execution only continues when connection is established over that exact URL I can't get. It makes me think that inspector.open does not really make sense with the wait === true.

Could this API be changed to something like below instead?

inspector.open(0, undefined, true, ({url}) => {
  clientPipe.send(url);  // <-- reports url
});
// <-- blocks execution.

@eugeneo, @ak239

@eugeneo
Copy link
Contributor

eugeneo commented Jul 13, 2019

I believe, this will help once it lands: #28453

@pavelfeldman
Copy link
Contributor Author

Yes, it does seem to help! Should it deprecate / remove wait in the inspector.open as well? That api is stability 1, can we fix it?

@eugeneo
Copy link
Contributor

eugeneo commented Jul 14, 2019

I do not feel strongly either way.

@addaleax addaleax added the inspector Issues and PRs related to the V8 inspector protocol label Jul 14, 2019
@jasnell
Copy link
Member

jasnell commented Jun 26, 2020

Any @nodejs/inspector ...is there anything further actionable here or can this be closed?

@benjamingr
Copy link
Member

James - looks like Pavel is right no one just felt strongly enough about it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inspector Issues and PRs related to the V8 inspector protocol
Projects
None yet
Development

No branches or pull requests

5 participants