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

Shim executables don't ensure termination of child processes #2272

Open
mitranim opened this issue May 14, 2021 · 1 comment
Open

Shim executables don't ensure termination of child processes #2272

mitranim opened this issue May 14, 2021 · 1 comment

Comments

@mitranim
Copy link

What You Are Seeing?

Abrupt termination of a shim executable causes its child to be orphaned. The child becomes a daemon process.

Note that this doesn't apply to Ctrl+C from the CLI, which is treated differently by the terminal or OS. The problem occurs when the process is killed through any other method.

What is Expected?

When a shim executable terminates for any reason, all work should be stopped, i.e. the subprocess should terminate. It should either:

  • Avoid spawning a subprocess.
  • Use the job objects API, ensuring that when it terminates, its descendants terminate.

How Did You Get This To Happen? (Steps to Reproduce)

This may happen due to programmatic termination of a shim process, or simply by clicking "End Process" in Task Manager or Process Explorer. Programmatic termination may happen in a build system that involves shelling out to various build tools such as sass. An error in one of the tasks may cause termination of the entire build, which may involve programmatic termination of immediate child processes, causing the orphan problem described above.

@mitranim
Copy link
Author

mitranim commented May 14, 2021

Programmatic termination is particularly important for watching-and-restarting, which is common in build systems. Currently, it's not viable to programmatically auto-restart executables generated by Choco, because the "real" process doesn't die.

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

No branches or pull requests

1 participant