microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
160.26k stars 28.08k forks source link

Git extension causing VSCode to slow down/not react #214530

Open bilogic opened 3 weeks ago

bilogic commented 3 weeks ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

https://github.com/microsoft/vscode/assets/946010/b260214f-4d94-4fbe-a32b-b80bd4dc2bce

  1. Git extensions scans my multiroot workspace infinitely after certain git operations, e.g. git reset --hard etc
  2. The scan causes the whole Code UI to become unresponsive, i.e. the scan seems to be thrashing
  3. Closing and reopening Chrome it makes the problem go away (implies VSCode and not code-server problem)
  4. This start sometime around 1.88.1
  5. I have always been performing the same git operations, usually scripted
  6. My desired solution is for this scanning to stop without having to restart my code-server
VSCodeTriageBot commented 3 weeks ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.90.0. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

bilogic commented 3 weeks ago

It is very obvious git extension had some big changes in 1.90, let me monitor. Thanks.

bilogic commented 3 weeks ago

The issue is still there in 1.90. When it "thrashes", clicking around in Source Control Repositories has no effect on Source Control, not sure what it is so busy with.

bilogic commented 3 weeks ago

I have to restart every 10-15 minutes of use... and I can't pinpoint the git operation that is causing it.

bilogic commented 3 weeks ago

I did a namespace search and replace across 107 files, git extension went thrashing and was not able to recover from it.

bilogic commented 2 weeks ago

This continues to be a problem in 1.90.1

lszomoru commented 1 week ago

@bilogic, sorry for not getting back to you on this until now. Given your hypothesis that the "git extension is thrashing" when you perform the git operation do you see many git commands being logged into the Git output window? I am asking since every single git operation gets logged there and in case of thrashing, I would expect tons of logs being written.

It is important to call out that any installed extension (not only the git extension) can display a progress indicator in the "Source Control" window. Could you please try to reproduce the problem with all extensions disabled except the Microsoft ones?

bilogic commented 1 week ago

Hmm if another extension displays a progress indicator, does it prevent Git from showing the changed files as I click between repositories? Because Git does not react when I click between the repos.

Let me see what I can do about removing all extensions.

lszomoru commented 1 week ago

The top of your recording is clipped of but from what I can see the UI seems responsive as you are clicking around so I am suspecting that the issue is with the extension host. All extensions are running within the same extension host so if you have a misbehaving extension then it may starve other extensions. I would try to narrow down the list of running extensions as much as possible in order to track down the extension that is causing this issue.

bilogic commented 1 week ago
  1. VSCode UI generally remains responsive but slower than usual, i.e. I can edit files, ctrl + p brings up the palette etc
  2. It is not shown in the video, but if I click between repos in Source Control Repositories, the Source Control portion does not change and continues with its progress bar
  3. The first time this happened was in 1.88.1 there abouts