-
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
--inspect should automatically get a new port if default port 9229 is already in use #28457
Comments
If you pass |
@cjihrig Thank you! I did not know about passing 0, the inspector documentation needs to be updated.
|
The "zero-port behavior" is not documented at the moment. Is it still valid? |
That behavior is still valid, I've opened a PR to document it: #53782 |
Apologies for the miscommunication. I wrote earlier that it didn't work (and then deleted the comment because I found out soon after that I was wrong). The error I was running into was produced by a userland thing, not node itself |
That's fantastic. Important The port should be a number, beware of passing a string as '0'. |
Is your feature request related to a problem? Please describe.
Image a kubernetes cluster using minikube with 50 micro-services on a dev environment, each micro-service is launched using the --inspect param, so we can remotely debug the services, like using vs-code kubernetes extension. In that case, just using --inspect or --inspect-brk will try to use the same inspector port 9229 for each micro-service, resulting on startup errors and services not running at all.
Describe the solution you'd like
--inspect and --inspect-brk should try the default port 9229, if the port is already in use, automatically get a random port that is not in use, or just increment the current port number until the port is available.
Describe alternatives you've considered
Manually setting an unique inspect port for each service. It means we must manually hard-code each unique inspector port for each micro-service config.
The text was updated successfully, but these errors were encountered: