-
Notifications
You must be signed in to change notification settings - Fork 498
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
Hang on startup when awaiting terminal PID #2491
Comments
Ok, think this was a stale build from the last issue. Trying to reproduce it isn't working. |
Right I just got it again... |
Adding some logging I see this:
It seems we are left waiting for the named pipe connection for some reason |
It seems the backend is working properly here but the client is not connecting to the named pipe... |
Log points showing we are stuck here: vscode-powershell/src/process.ts Line 125 in 17d9a59
Pausing in the debugger shows us in |
@rjmholt anything else useful in that pause? Maybe we should bring Danial in since it's terminal related? |
Unfortunately there's really not much to go on. When I next reproduce it I'll take a full screenshot |
@rjmholt does it look like this? I have that every time I open certain workspaces. Maybe related to number of files or number of open editors. Pictured is PowerShell/PowerShell, happens every reload. This is PowerShell 7. If I |
Yeah the terminal looks like that (although I see all the diagnostic logs). I'm also testing it with PowerShell/PowerShell and WinPS + PS7, but only get it occasionally. As I debug it, the server side seems to be behaving correctly; the reason you're only seeing the single runspace and that cmdlet is because we're still in there waiting for the client to connect. So the terminal prints the banner and then is left waiting for something from the named pipe to progress. But VSCode isn't connecting, because it seems to be stuck waiting for the terminal PID. It never proceeds to named pipe connection. |
I wonder if this is actually a symptom of #2377 or at least related to it |
@Tyriar, just quickly, does #2491 (comment) look at all familiar to you? |
Haven't had any reports of processId not resolving on my end. |
@rjmholt The workaround build you provided resolved my hang. |
Fixed in #2498 |
Just to document a bit more, I can reproduce this with the following change from d431617: diff --git a/src/process.ts b/src/process.ts
index aa957b5..b70966e 100644
--- a/src/process.ts
+++ b/src/process.ts
@@ -128,7 +128,9 @@ export class PowerShellProcess {
// Log that the PowerShell terminal process has been started
this.log.write("Registering terminal PID log callback");
- this.consoleTerminal.processId.then((pid) => this.logTerminalPid(pid, pwshName));
+ const pid = await this.consoleTerminal.processId;
+ this.logTerminalPid(pid, pwshName);
+ // this.consoleTerminal.processId.then((pid) => this.logTerminalPid(pid, pwshName));
return sessionDetails;
} So startup pauses, since the client never opens a named pipe. The debugging the server shows it waiting on a named pipe connection. In the client, pausing the debugger shows us stopped here: For whatever reason we are left awaiting the I've only seen reports of this on Windows. |
Working with current master, I'm getting an occasional (about 50% of the time) hang on startup in Windows PowerShell.
This is again mysterious like the last issue I opened:
However, there's no dispose issue here.
Debugging the progress of this seems to interfere with the possibility of this deadlock occurring.
The log progresses to this point:
The text was updated successfully, but these errors were encountered: