Skip to content

"Stopping extension hosts" takes a long time #6015

Closed

Description

@DanTup

I've been seeing this message today whenever I close VS Code or change workspace.

At first I thought it was a VS Code issue, however microsoft/vscode#306129 mentions it might be related to extension child processes, and @zeikman noted in microsoft/vscode#305999 that it was being caused by this extension.

We do have a lot of processes that we try to clean up in deactivate(), but we should check whether this is all working correctly and whether any of them are slow to shut down.

Activity

  1. added this to the v3.132.0 milestone on Mar 30, 2026
  2. DanTup commented on Mar 30, 2026

    @DanTup
    MemberAuthor

    Seems like the Flutter daemon might not be terminating quickly, which might be causing this hold-up.

    [2:02:17 PM] [General] [Info] Extension deactivate was called (isRestart: false)
    [2:02:17 PM] [General] [Warn] Starting cleanup for setCommandVisiblity
    [2:02:17 PM] [General] [Warn] Starting cleanup for maybeAnalyzer
    [2:02:17 PM] [General] [Warn] Starting cleanup for flutterDaemon
    [2:02:17 PM] [General] [Warn] Starting cleanup for setContext
    [2:02:17 PM] [General] [Warn] Starting cleanup for logger
    [2:02:17 PM] [General] [Warn] Starting cleanup for logger
    [2:02:17 PM] [General] [Warn] Starting cleanup for logger
    [2:02:17 PM] [General] [Warn] Starting cleanup for logger
    [2:02:17 PM] [General] [Warn] Starting cleanup for logger
    [2:02:17 PM] [General] [Warn] Finished cleanup for setCommandVisiblity
    [2:02:17 PM] [General] [Warn] Finished cleanup for maybeAnalyzer
    [2:02:17 PM] [General] [Error] Error cleaning up setContext during extension shutdown: Canceled: Canceled
    [2:02:17 PM] [DevTools] [Error] Process D:\Dev\Google\Flutter\Flutter main\bin\cache\dart-sdk\bin\dart.exe terminated! 1, null
    [2:02:17 PM] [General] [Warn] Finished cleanup for logger
    [2:02:17 PM] [General] [Warn] Finished cleanup for logger
    [2:02:17 PM] [General] [Warn] Finished cleanup for logger
    [2:02:17 PM] [General] [Warn] Finished cleanup for logger
    [2:02:17 PM] [General] [Warn] Finished cleanup for logger
    
    [2:02:17 PM] [General] [Warn] Starting cleanup for flutterDaemon
    [2:02:17 PM] [FlutterDaemon] [Info] ==> [{"id":"4","method":"daemon.shutdown"}]
    [2:02:17 PM] [General] [Warn] Starting cleanup for setContext
    [2:02:17 PM] [General] [Warn] Starting cleanup for logger
    [2:02:17 PM] [General] [Warn] Starting cleanup for logger
    Mon Mar 30 2026 [14:02:17 GMT+0100 (British Summer Time)] Log file ended
    
  3. 00xmario commented on Mar 30, 2026

    @00xmario

    I don't have this extension installed and it still happens:
    Image

  4. DanTup commented on Mar 30, 2026

    @DanTup
    MemberAuthor

    @mariomakdis by "this extension" do you mean the Dart one?

    My current theory is that many extensions are slow at shutting down, and VS Code used to hide/ignore this, but now they are waiting longer and showing this dialog.

    I'm surprised they're not naming the extensions on that popup to help track down who's causing it though. You could try using VS Code's extension bisect to narrow down which extension is causing it for you.

  5. DanTup commented on Mar 30, 2026

    @DanTup
    MemberAuthor

    It turns out that VS Code always allowed the full time to shutdown, but the recent change (which was a bug) was making the UI wait for it. So the next version of VS Code would've prevented this showing up, although in the background we still would've been hanging until it terminated us (but now we will not).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions