Skip to content

Rework locking and eventing during startup and shutdown to alleviate some VT issues#2525

Merged
miniksa merged 29 commits intomasterfrom
dev/miniksa/1810_attempt4
Sep 20, 2019
Merged

Rework locking and eventing during startup and shutdown to alleviate some VT issues#2525
miniksa merged 29 commits intomasterfrom
dev/miniksa/1810_attempt4

Conversation

@miniksa
Copy link
Member

@miniksa miniksa commented Aug 23, 2019

Summary of the Pull Request

Adjusts the startup and shutdown behavior of most threads in the console host to alleviate race conditions that are either exacerbated or introduced by the VT PTY threads.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

…t leaves such that we can clean everything up appropriately.
…ge to tell the input thread it is allowed to operate under the lock the IO thread is holding. Without this, the signal thread breaking and shutting down may be able to acquire the lock in a split second and cause unexpected oddities to occur for shutting down console context while it is being allocated for a client.
@miniksa
Copy link
Member Author

miniksa commented Aug 26, 2019

Please see MicrosoftDocs/Console-Docs#100 for my proposal on documentation updates.

@miniksa
Copy link
Member Author

miniksa commented Aug 28, 2019

OK. I need to adapt the little test utility into a feature test for this to ensure that it remains working and stable into the future and then this will be good to go.

@miniksa
Copy link
Member Author

miniksa commented Sep 10, 2019

Table of the most recent failure run (since run data is trimmed over time).

metadata endSession inheritCursor readOutput writeInput
2 2 T T T
6 0 T F T
11 2 F F T
16 1 F T F
20 2 T F F

I updated the test to provide more verbose logging of what it is doing while it runs so I can maybe figure out where exactly it's hanging.

The table above is the runs that failed. I can't tell if it's always these 5 or if those are a random 5 because the previous run data was pruned.

On my local machine, I cannot seem to reproduce this issue. So I'm trying to come up with a way to figure out what's going wrong in the lab. The error code given is 0xc0000374 which is STATUS_HEAP_CORRUPTION. But I would think that if I screwed something up about allocations and freeing in the test to cause corruption that perhaps it would be in all inheritCursor = TRUE tests or something, not what looks like a random 5.

We'll see what happens in this CI run and I'll keep looking tomorrow.

@miniksa
Copy link
Member Author

miniksa commented Sep 11, 2019

OK current CI run failures:

4, 7, 13, 16, 18, 22. Same error code. So it's not specific tests... its something about the tests overall.

@miniksa
Copy link
Member Author

miniksa commented Sep 11, 2019

OK. Isolating the runs resolves this issue. This is now ready for review.

@miniksa miniksa marked this pull request as ready for review September 11, 2019 20:25
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.

I mostly just have questions and nits

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.

👍

@miniksa miniksa merged commit 56c3594 into master Sep 20, 2019
@miniksa miniksa deleted the dev/miniksa/1810_attempt4 branch September 20, 2019 22:43
DHowett-MSFT pushed a commit that referenced this pull request Sep 26, 2019
…some VT issues (#2525)

Adjusts the startup and shutdown behavior of most threads in the console host to alleviate race conditions that are either exacerbated or introduced by the VT PTY threads.

(cherry picked from commit 56c3594)
miniksa added a commit that referenced this pull request Nov 8, 2019
…leviate some VT issues (#2525)"

This reverts commit 56c3594.

Also patches up some build fixes made after it and corrects a VtRendererTest that was dependent on the locks.
@miniksa miniksa mentioned this pull request Nov 8, 2019
5 tasks
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.

ClosePseudoConsole API hanging

4 participants