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

Remove job object and startup suspended behavior #2198

Merged
merged 1 commit into from
Aug 2, 2019
Merged

Conversation

miniksa
Copy link
Member

@miniksa miniksa commented Aug 1, 2019

Summary of the Pull Request

Removes the ConhostConnection work that set up a job object and created everything suspended. I don't believe this is or should be necessary as the ConPTY'd conhost should realize that the server end of the connection is gone and gracefully shut down (and tell its clients to shut down).

PR Checklist

Detailed Description of the Pull Request / Additional comments

I believe that using a job here is just covering up an underlying problem with outstanding handles, bad eventing, or other message communication failures. The job is a big hammer solution to just terminate everything when the terminal goes down, which I believe is responsible for some of the pwsh.exe post-mortem debugger sessions I'm seeing (as the conhost goes down and then pwsh throws an unhandled exception).

Overall, if there's an issue in this area, I think we can debug and diagnose it individually and fix the leftover handle, untriggered/unhandled event, etc. So I'm taking out the job object and we'll see how things go.

Also, I believe some of the issues that this was covering up have been resolved in other ways between when it was installed and now. I did some playing around and didn't get any orphaned conhost.exes (or their clients). So this must be already better than it used to be.

Validation Steps Performed

Launched Terminal, closed it normally.
Launched Terminal, killed it in process explorer.
Launched Terminal with many tabs of varying types (pwsh, powershell, cmd) and killed Terminal in process explorer.

In all cases, the conhosts and their children were cleaned up appropriately without the job object.

Copy link
Contributor

@DHowett-MSFT DHowett-MSFT left a comment

Choose a reason for hiding this comment

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

Potential 0.3 QOL fix?

Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

Does this actually close #2185, or does it just open the door to investigating it?

I'd also make sure that closing a non-final wsl tab doesn't cause the terminal to crash, because that was something mentioned in #1445 which seems similar

@zadjii-msft
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@miniksa
Copy link
Member Author

miniksa commented Aug 2, 2019

Does this actually close #2185, or does it just open the door to investigating it?

I'd also make sure that closing a non-final wsl tab doesn't cause the terminal to crash, because that was something mentioned in #1445 which seems similar

Opens the door to investigate it more. I'll make sure it gets reactivated when merging this closes it.

And I'll keep working on testing scenarios around the exit.

@ghost
Copy link

ghost commented Aug 27, 2019

🎉Windows Terminal Preview v0.4.2382.0 has been released which incorporates this pull request.:tada:

Handy links:

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.

Find the actual issue keeping conhosts from exiting when tabs are closed
3 participants