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

Is it not possible to kill shelled process? #419

Closed
wants to merge 2 commits into from

Conversation

gaggle
Copy link

@gaggle gaggle commented Apr 12, 2020

It seems to me that a process started with shell:true don't always get killed properly.

Here I've added tests that uses Linux's sleep, and killing the non-shell version works fine but the shelled version hangs the test-suite for the 200 seconds. The sleep sits in the process list, unkilled.

Is this expected behaviour? To my understanding a shelled process should receive signals just as well as any other process, but happy to learn otherwise.

Comment on lines +33 to +40
test('`kill` should kill a shell process cleanly', async t => {
const subprocess = execa('sleep', ['200'], { shell: true, stdio: ['ipc'] });

subprocess.kill('SIGTERM', { forceKillAfterTimeout: 2000 });

await t.throwsAsync(subprocess);
t.false(isRunning(subprocess.pid));
})
Copy link
Author

Choose a reason for hiding this comment

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

This test hangs the test-suite for the duration of the sleep, waiting for the process to stop

@ehmicky
Copy link
Collaborator

ehmicky commented Apr 12, 2020

This is due to #96. See my new comment on that issue.

Since this is a well-known issue, I suggest this PR to be closed if this is ok with you @gaggle?

@gaggle
Copy link
Author

gaggle commented Apr 12, 2020

This is due to #96. See my new comment on that issue.

Since this is a well-known issue, I suggest this PR to be closed if this is ok with you @gaggle?

Oh I didn't see that issue, thanks. Yes of course, this PR was just to illustrate my question.

@gaggle gaggle closed this Apr 12, 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