Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Graceful termination in Windows #600

Merged
merged 1 commit into from
Sep 11, 2020

Conversation

areller
Copy link
Contributor

@areller areller commented Jul 19, 2020

Before this change, Tye would CloseMainWindow but that didn't have any effect because CreateNoWindow was set to true in the ProcessStartInfo.

Now, when in Windows, I run the process with an invisible window and when I call CloseMainWindow, I wait 5 seconds for the process to exit gracefully (just like in Unix), before it's forcefully killed.

If CloseMainWindow fails (host can run from an environment where spawning windows is not possible), I default to killing the process (just like it has behaved before for Windows).

This solves a problem that I was having, I had an executable (parent) that launched another executable (child) and when Tye killed the parent, it would the child hanging.

@areller
Copy link
Contributor Author

areller commented Jul 27, 2020

Do you have any thoughts about this one? @davidfowl @jkotalik

@jkotalik jkotalik closed this Aug 31, 2020
@jkotalik jkotalik reopened this Aug 31, 2020
Copy link

@JunTaoLuo JunTaoLuo left a comment

Choose a reason for hiding this comment

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

LGTM

@JunTaoLuo JunTaoLuo merged commit 7c66037 into dotnet:master Sep 11, 2020
@areller areller deleted the windows-graceful-term branch September 12, 2020 21:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants