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

Debug SocketCluster in VS Code #517

Open
5 tasks
MegaGM opened this issue Oct 19, 2019 · 3 comments
Open
5 tasks

Debug SocketCluster in VS Code #517

MegaGM opened this issue Oct 19, 2019 · 3 comments

Comments

@MegaGM
Copy link
Member

MegaGM commented Oct 19, 2019

What's wrong?

Visual Studio Code doesn't respect breakpoints in child processes, such as workers and brokers, scworkercluster and sc-broker-cluster, when I try to debug SocketCluster with VS Code's internal debugger.

How could it be fixed?

We could change a couple of lines of code, a line in socketcluster and a line in sc-broker

from

execOptions.execArgv.push('--inspect=' + inspectPort);

to

execOptions.execArgv.push('--inspect-brk=' + inspectPort);

and breakpoints will work as expected.

What do I propose?

To add a couple of new CLI arguments.
--inspect-brk-workers and
--inspect-brk-brokers

Checklist

--inspect-brk-workers
--inspect-brk-workers=port
--inspect-brk-workers=host:port

--inspect-brk-brokers
--inspect-brk-brokers=port
--inspect-brk-brokers=host:port
  • The type signature of --inspect-workers and --inspect-brokers CLI arguments should be updated as well, to comply with the original --inspect
--inspect-workers
--inspect-workers=port
--inspect-workers=host:port

--inspect-brokers
--inspect-brokers=port
--inspect-brokers=host:port
@MegaGM MegaGM changed the title SocketCluster in VS Code Debug SocketCluster in VS Code Oct 19, 2019
@seiyria
Copy link

seiyria commented Jun 9, 2020

If I were to start a PR for this, is this something that would be accepted and merged fairly quickly?

@jondubois
Copy link
Member

@seiyria The latest SC version v16 does not have this problem because it no longer spawns multiple processes (it focuses on horizontal scalability across multiple hosts instead) so we can now debug each process individually.

That said if you want to make this change and maintain it yourself in a forked repo, then we could link to this repo from the website somewhere. I just don't have the bandwidth to maintain 2 different versions of SC anymore.

@seiyria
Copy link

seiyria commented Jun 10, 2020

@jondubois thanks for replying. If I were to fork it, it would really only be for this particular feature since I don't have the technical knowhow to really maintain SC, but if I do, I'll be sure to post back here. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants