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

conpty process blocked update on Windows #225719

Open
connor4312 opened this issue Aug 15, 2024 · 14 comments
Open

conpty process blocked update on Windows #225719

connor4312 opened this issue Aug 15, 2024 · 14 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member install-update VS Code installation and upgrade system issues papercut 🩸 A particularly annoying issue impacting someone on the team terminal-conpty Integrated terminal issues related to the ConPTY backend terminal-process Problems launching processes, managing ptys, exiting, process leaks, etc. windows VS Code on Windows issues
Milestone

Comments

@connor4312
Copy link
Member

connor4312 commented Aug 15, 2024

I attempted to update Insiders today using the usual "apply update and restart" action and ran into the following error. It looks like some console-related processes blocked update. No VS Code windows were open.

image

The command line of the process doing the blocking was:

"c:\Users\conno\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\node_modules.asar.unpacked\node-pty\build\Release\conpty\OpenConsole.exe" --headless --inheritcursor --width 80 --height 30 --signal 0x638 --server 0x69c

I am using the new windowsUseConptyDll setting, if that matters.

@joaomoreno
Copy link
Member

#225160

@joaomoreno joaomoreno closed this as not planned Won't fix, can't repro, duplicate, stale Aug 16, 2024
@deepak1556 deepak1556 reopened this Aug 26, 2024
@deepak1556 deepak1556 self-assigned this Aug 26, 2024
@deepak1556 deepak1556 added bug Issue identified by VS Code Team member as probable bug install-update VS Code installation and upgrade system issues terminal-conpty Integrated terminal issues related to the ConPTY backend terminal-process Problems launching processes, managing ptys, exiting, process leaks, etc. windows VS Code on Windows issues labels Aug 26, 2024
@deepak1556 deepak1556 added this to the August 2024 milestone Aug 26, 2024
@deepak1556
Copy link
Collaborator

Upon killing the processes hold the lock and taking the update, the restored terminals show as disconnected, and I could not create new terminals until I restarted vscode:

image

Edit: so far 4 for 4 on hitting this each time I update Insiders

Originally posted by @connor4312 in #225160 (comment)

@deepak1556
Copy link
Collaborator

@connor4312 I am looking to repro but maybe I am missing some steps, can you confirm. Is there any particular set of terminal commands that trigger this issue ?

  • Launch Inisders with windowsUseConptyDll enabled
  • Open terminals with long running tasks, ex: yarn in vscode repo
  • Check and restart for update (tested with both backgroundupdates enabled and disabled)
  • Update completed without issues

@connor4312
Copy link
Member Author

connor4312 commented Aug 27, 2024

That's right. But specifically, I usually have the vscode-copilot repo open which has its long running watch tasks, so that may also be a part of it.

@deepak1556
Copy link
Collaborator

Didn't have any luck with the copilot repo as well, can you try the following steps before applying the next update

  • Open Windows Performance Recorder from system start menu
  • Enable the following settings, in the resource analysis section specifically CPU usage, Disk I/O activity, File I/O activity, Registry I/O activity, Handle usage

Screenshot 2022-08-23 200440

  • Start the recorder
  • Perform the update
  • Once the access denied error happens, stop the recorder and save the profile
  • Send the profile to [email protected] instead of attaching to this issue, since it will contain sensitive information.

@connor4312
Copy link
Member Author

Thanks, sent!

@deepak1556 deepak1556 added the confirmed Issue has been confirmed by VS Code Team member label Aug 29, 2024
@deepak1556
Copy link
Collaborator

Thanks for the profile, based on the process lifetimes I was able to backtrack the steps that might repro the issue and I now have a reliable repro,

  • Launch insiders with windowsUseConptyDll on the vscode-copilot repo
  • Background OpenConsole.exe process will be created for each of the npm tasks
  • Use the debug task to launch Copilot extension
  • Close the debugger window
  • the debugee window will close shortly but OpenConsole.exe process is leaked and end up locking the resources folder

I feel the scenario during the update might have been the same, @connor4312 just to validate this scenario can you check if update fails when you don't have any debugging session.

@connor4312
Copy link
Member Author

I updated Insiders today without a debugging session and didn't run into the issue 🙂

@Tyriar
Copy link
Member

Tyriar commented Sep 13, 2024

I saw this just now:

Image
Image

@connor4312
Copy link
Member Author

connor4312 commented Oct 14, 2024

This broke my Insiders build today, I think I tried to cancel setup when the issue happened and then I opened Insiders again to see if that would work without digging out LockHunter. The update failed and then gave the "antivirus might have interfered with the update" error, and I had to reinstall Insiders at that point.

@connor4312
Copy link
Member Author

Today and for the mid-day Insiders yesterday I was much more careful about the update

just to validate this scenario can you check if update fails when you don't have any debugging session.

This does happen even when there is no debugging session active. In both cases I had the task terminals open for Copilot Chat, so I suspect maybe task reconnection logic is related to this issue

@connor4312 connor4312 added the papercut 🩸 A particularly annoying issue impacting someone on the team label Oct 15, 2024
@Tyriar
Copy link
Member

Tyriar commented Oct 16, 2024

@deepak1556 was going to check this out when he's free 🙏

@deepak1556
Copy link
Collaborator

Didn't have much cycles this milestone due to my vacation, I will look into this in the next debt week.

@sbatten
Copy link
Member

sbatten commented Nov 14, 2024

By the way I've been seeing this every day since I have been debugging copilot chat simulations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member install-update VS Code installation and upgrade system issues papercut 🩸 A particularly annoying issue impacting someone on the team terminal-conpty Integrated terminal issues related to the ConPTY backend terminal-process Problems launching processes, managing ptys, exiting, process leaks, etc. windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

5 participants