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

process: use defaults when spawning a child_process #6561

Merged
merged 1 commit into from
Nov 18, 2019
Merged

Conversation

paul-marechal
Copy link
Member

What it does

While the typings allow for undefined values, the behavior is actually
nasty: If you leave args undefined, then options are ignored. This
could lead to stdio pipes not being set correctly.

How to test

It happened to me when contributing a debug adapter using our internal contribution points:

@injectable()
export class SomeDebugAdapterContribution implements DebugAdapterContribution {
    provideDebugAdapterExecutable(): DebugAdapterExecutable {
        return {
            modulePath: 'somePath',
            // no `args` field, typings are ok with that.
        };
    }
}

In this case, the debug adapter was spawned, but nothing was happening. No errors too.

Review checklist

Reminder for reviewers

While the typings allow for undefined values, the behavior is actually
nasty: If you leave `args` undefined, then `options` are ignored. This
could lead to stdio pipes not being set correctly.

Signed-off-by: Paul Maréchal <paul.marechal@ericsson.com>
@paul-marechal paul-marechal added bug bugs found in the application process issues related to the process extension labels Nov 15, 2019
@@ -102,13 +102,13 @@ export class RawProcess extends Process {
if (this.isForkOptions(options)) {
this.process = fork(
options.modulePath,
options.args,
options.options);
options.args || [],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only this line might be necessary, but it doesn't cost much to provide sane defaults in the other places too.

@paul-marechal paul-marechal merged commit 1e27c2b into master Nov 18, 2019
@paul-marechal paul-marechal deleted the mp/da-exe branch November 18, 2019 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application process issues related to the process extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants