vscode-pull-request-github: Slow down VS Code interface when some git commands are run

Ever since the last version of VS Code (1.75.0), and presumably the last version of this extension (0.58.0), I’ve been experiencing horrible interface freezes and crashes. Today I’ve found out they’re related to git commands, and this extension.

  • Extension version: 0.58.0
  • VSCode Version: 1.75.0
  • OS: Ubuntu 22.04

Steps to Reproduce:

  • On some repositories (the one I can reproduce it on is private, so sorry for not helping there)
  • Open “Running extensions”
  • Start profile
  • Edit a file, save
  • Open the terminal in vs code
  • run git add <file>
  • run git commit --amend --no-edit
  • Wait about 3-5 seconds
  • Have the entire interface freeze for anything between 5 and 30 full seconds
  • Either:
    • VS Code crashes, so you’ll have to try again (reported crash is that the extension host was killed)
    • The profile succeeds, and puts this extension squarely at the top of the profile,

Notes

  • The freezing and crashing sometimes happens randomly. As in, I’ll be using a different application altogether, and when I go back to VS Code I suddenly find it with the “Hey I crashed lol” window.
  • The above point could be explained by me running a reproducing git command before switching to the mentioned different program.
  • Screenshot below shows how this extension takes a ridiculous amount of time. I’m assuming this is interface time, and not background thread time, so that would be this extension blocking the interface for 4 seconds.
  • See profile_results.txt for an exact profile. I have no idea how to read this, but I’m hoping you do.

Screenshot_20230208_171219

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 18 (6 by maintainers)

Most upvoted comments

Interestingly, this bug appears to be MIA on my devices. I haven’t had it happen at all recently. I’m not sure if this is now fixed, but looking at the changelog, I think the cause of this issue might just have been similar to this:

https://github.com/microsoft/vscode-pull-request-github/issues/4595

I do have the following set of custom queries, which do not mention any org, but they do mention a user (which is also an organisation on GitHub)

{
    "githubIssues.queries": [
        {
            "label": "",
            "query": "asdlkfjsdlkfjadslkjfawlkjclaksjfdlkasjflkajoijvcwoivjwoijfvaksjdvlawkjvliawejvlasdkjvalwiejvlaskjvalwiejv"
        },
        {
            "label": "Created in this repo",
            "query": "author:${user} state:open repo:${owner}/${repository} sort:created-desc"
        },
        {
            "label": "Created in my-company",
            "query": "is:open author:${user} user:my-company sort:created-desc"
        },
        {
            "label": "Created outside of my-company",
            "query": "is:open author:${user} -user:my-company sort:created-desc"
        },
        {
            "label": "Personal issues",
            "query": "is:open is:issue user:FPtje"
        }
    ],
    "githubPullRequests.queries": [
        {
            "label": "Waiting For My Review",
            "query": "is:open review-requested:${user}"
        },
        {
            "label": "Reviewed",
            "query": "is:open reviewed-by:${user}"
        },
        {
            "label": "Assigned To Me",
            "query": "is:open assignee:${user}"
        },
        {
            "label": "Created By Me",
            "query": "is:open author:${user}"
        },
        {
            "label": "Mentioned Me",
            "query": "is:open mentions:${user}"
        }
    ]
}

Given that the above issue is fixed in 0.64, and the crashing for me stopped at give-or-take the same time, I think this explanation is plausible. If it is then I would like to thank you very kindly for fixing it.

Shall we close this issue and open a new issue if the mysterious hang/crash bug comes back to haunt us once again?

Thanks for the crash logs @FPtje , from the logs all of them point to out of memory in the extension host. @alexr00 would be good to investigate for a memory leak in the pull request extension.

@FPtje can you collect the memory profile of the extension host by following the steps below,

  1. Quit all instances of VSCode and launch with --inspect-extensions=9229
  2. In your chrome browser visit chrome://inspect/#devices or in edge browser visit edge://inspect/#devices
  3. Click the link Open dedicated developer tools for Node
  4. In the newly open devtools window, under the connection Tab add an entry localhost:9229
  5. Wait for a few seconds and the devtools should connect to the extension host of VSCode
  6. Now visit the Memory tab in the developer tools, check the following settings and start the profiler
Screenshot 2023-05-15 at 19 32 57
  1. Go back to VSCode and perform the operations related to the pull request extension and before the crash happens stop the profiler
  2. Attach the generated profile in this issue.

I’ve had a similar experience since updating to Extension version: 0.58.0 / VSCode Version: 1.75.0 on Windows 10. It is actually causing the extension host to crash on an out of memory error and reload. I’m seeing lots of the following log entries below in the exthost.log file until it eventually crashes and restarts. It looks like it’s making multiple requests a millisecond, so possible an issue related to a missing failure back off or other rate limiting issue?

2023-02-09 11:25:24.984 [error] Error: Network error: request to https://<github enterprise server>/api/graphql failed, reason: read ECONNRESET
    at new e (c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:139)
    at c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:20919
    at c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:26875
    at Set.forEach (<anonymous>)
    at c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:26852
    at Map.forEach (<anonymous>)
    at i.broadcastQueries (c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:26803)
    at c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:19529
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
2023-02-09 11:25:24.984 [error] Error: Network error: request to https://<github enterprise server>/api/graphql failed, reason: read ECONNRESET
    at new e (c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:139)
    at c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:20919
    at c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:26875
    at Set.forEach (<anonymous>)
    at c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:26852
    at Map.forEach (<anonymous>)
    at i.broadcastQueries (c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:26803)
    at c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:19529
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
2023-02-09 11:25:24.985 [error] Error: Network error: request to https://<github enterprise server>/api/graphql failed, reason: read ECONNRESET
    at new e (c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:139)
    at c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:20919
    at c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:26875
    at Set.forEach (<anonymous>)
    at c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:26852
    at Map.forEach (<anonymous>)
    at i.broadcastQueries (c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:26803)
    at c:\Users\tsamaras\.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1446:19529
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

disabling this extension stopped the crashes.