-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Closing tab hangs when using VS Dev tools and Powershell Core #14032
Comments
I suspect you are right, I did a few heap dumps to see if I could spot anything of note and I noticed they were both hung on the same line related to the conpty connect, specifically this line https://github.com/microsoft/terminal/blob/main/src/cascadia/TerminalConnection/ConptyConnection.cpp#L557 |
Ah right... The old version used to close the connection in the background only, so it didn't matter how long it took and it wasn't visually apparent either: 666c446#diff-baa2e4fc26af1b8722a4eec13221622ef4ae566e4f7a8658bc58806f96b7e9b8L1525-L1526 |
@lhecker, I just double checked - I'm hung on the same line. The one I posted earlier was down further in the stack. |
`ConptyClosePseudoConsole` blocks until OpenConsole exits. This is problematic for the changes in 666c446, which stopped calling that function on a background thread to solve a race condition. This commit fixes the potential lags/deadlocks from waiting on OpenConsole's exit, by adding `ConptyClosePseudoConsoleNoWait` which only closes the IO handles and allows OpenConsole to exit naturally. This uncovered another potential deadlock in `ServiceLocator::RundownAndExit` which might call itself recursively. Closes #14032 ## Validation Steps Performed * Print tons of text and concurrently close the tab. Tab closes, OpenConsole/pwsh exits instantly ✅ * Use `Enter-VsDevShell` and close the tab. Tab closes instantly, OpenConsole/pwsh exits after ~5 seconds ✅
`ConptyClosePseudoConsole` blocks until OpenConsole exits. This is problematic for the changes in 666c446, which stopped calling that function on a background thread to solve a race condition. This commit fixes the potential lags/deadlocks from waiting on OpenConsole's exit, by adding `ConptyClosePseudoConsoleNoWait` which only closes the IO handles and allows OpenConsole to exit naturally. This uncovered another potential deadlock in `ServiceLocator::RundownAndExit` which might call itself recursively. Closes #14032 ## Validation Steps Performed * Print tons of text and concurrently close the tab. Tab closes, OpenConsole/pwsh exits instantly ✅ * Use `Enter-VsDevShell` and close the tab. Tab closes instantly, OpenConsole/pwsh exits after ~5 seconds ✅ (cherry picked from commit 274bdb3) Service-Card-Id: 85767341 Service-Version: 1.16
🎉This issue was addressed in #14041, which has now been successfully released as Handy links: |
`ConptyClosePseudoConsole` blocks until OpenConsole exits. This is problematic for the changes in 666c446, which stopped calling that function on a background thread to solve a race condition. This commit fixes the potential lags/deadlocks from waiting on OpenConsole's exit, by adding `ConptyClosePseudoConsoleNoWait` which only closes the IO handles and allows OpenConsole to exit naturally. This uncovered another potential deadlock in `ServiceLocator::RundownAndExit` which might call itself recursively. Closes #14032 ## Validation Steps Performed * Print tons of text and concurrently close the tab. Tab closes, OpenConsole/pwsh exits instantly ✅ * Use `Enter-VsDevShell` and close the tab. Tab closes instantly, OpenConsole/pwsh exits after ~5 seconds ✅ (cherry picked from commit 274bdb3) Service-Card-Id: 86209670 Service-Version: 1.15
🎉This issue was addressed in #14041, which has now been successfully released as Handy links: |
Windows Terminal version
1.16.2524.0
Windows build number
10.0.25201.0
Other Software
Steps to reproduce
pwsh.exe
in Windows Terminal PreviewExpected Behavior
Tab closes quickly.
Actual Behavior
wt locks up entirely doing...something.
I've tested this with the release version of Windows Terminal and also regular powershell.exe. Both of those don't exhibit the behavior. It is only with Powershell Core, the most recent release of wt.exe and the Visual Studio dev tools
The text was updated successfully, but these errors were encountered: