Skip to content

--inspect flag and cluster module - Debug port numbers not incrementing #8201

@jondubois

Description

@jondubois
  • Version: 6.4.0
  • Platform: Ubuntu
  • Subsystem: cluster

When using the --debug=6000 flag with the cluster module, the first debug port 6000 would be assigned to the cluster master, then the first worker would be assigned to 6001, then the second worker would be assigned to 6002, etc...

See https://strongloop.com/strongblog/whats-new-nodejs-v0-12-debugging-clusters/

However, when using the new --inspect=6000 flag with the cluster module, the cluster master process is assigned 6000 (which is correct) but the first worker is assigned 5859 (instead of the expected 6001), second worker is 5860 (instead of 6002), etc...

So this prevents us from changing the default debug ports for workers forked using the cluster module.

I tried messing with the settings on the cluster module by passing custom execArgv options such as: cluster.setupMaster({execArgv: ["--inspect=6001"]}) (I tried a few variations) but it doesn't appear to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    inspectorIssues and PRs related to the V8 inspector protocol

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions