Skip to content

Separate process wrappers and pass arguments #2334

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

Merged
merged 4 commits into from
Nov 19, 2020
Merged

Separate process wrappers and pass arguments #2334

merged 4 commits into from
Nov 19, 2020

Conversation

code-asher
Copy link
Member

This is to fix #2316.

Previously we only deleted PASSWORD in the child process but now it's deleted in the parent (which I think is good since that means it'll be hidden from the VS Code CLI spawn as well and anything else we might spawn from the parent in the future).

But as a consequence the child no longer has access to PASSWORD and can't use it when parsing the arguments. This PR fixes that by passing the arguments from the parent to the child.

As a bonus this means we only have to do the parsing once, including if it gets restarted via a SIGUSR1.

Since it was getting a little convoluted with all the if statements I split out the child and parent process wrappers which I think makes it all a little more clear. Also was able to re-use onMessage from the VS Code wrapper.

I think having them combined and relying on if statements was getting
confusing especially if we want to add additional messages with
different payloads (which will soon be the case).
Also move our memory default to the beginning of NODE_OPTIONS so it can
be overidden. The version of the flag with dashes seems to be the more
correct one now so use that instead of underscores.

Related: #2113.
@code-asher code-asher requested a review from nhooyr as a code owner November 18, 2020 19:35
@code-asher code-asher merged commit 4380356 into master Nov 19, 2020
@code-asher code-asher deleted the wrappers branch November 19, 2020 16:28
@nhooyr nhooyr added this to the v3.7.2 milestone Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants