Skip to content

Investigate large number of configurationChange extension restarts #5837

Open

Description

@DanTup

Stats show that a huge portion of extension restarts are "configurationChange". Which indicates that one of the following settings changed:

function getSettingsThatRequireRestart() {
// The return value here is used to detect when any config option changes that requires a project reload.
// It doesn't matter how these are combined; it just gets called on every config change and compared.
// Usually these are options that affect the analyzer and need a reload, but config options used at
// activation time will also need to be included.
return "CONF-"
+ config.sdkPath
+ config.sdkPaths?.length
+ config.analyzerPath
+ config.analyzerDiagnosticsPort
+ config.analyzerVmServicePort
+ config.analyzerInstrumentationLogFile
+ config.extensionLogFile
+ config.analyzerAdditionalArgs?.join(",")
+ config.analyzerVmAdditionalArgs?.join(",")
+ config.flutterSdkPath
+ config.flutterSdkPaths?.length
+ config.flutterSelectDeviceWhenConnected
+ config.closingLabels
+ config.analyzeAngularTemplates
+ config.analysisServerFolding
+ config.showMainCodeLens
+ config.showTestCodeLens
+ config.updateImportsOnRename
+ config.flutterOutline
+ config.flutterAdbConnectOnChromeOs;
}

Some of the logs I've seen recently made me wonder whether this was firing during startup (and this could perhaps explain some very short analyzer sessions), but I can't come up with a reason why this would fire automatically (maybe settings sync?).

It could be worth trying to trim this list right down (for example things like CodeLens could just be handled in the provider with onDidChangeCodeLensesEmitter), and then what's left could be appended to the reason string so we can see if there is a pattern to what's happening most common.

It's very possible that the use is legit (for example switching SDKs frequently, as I do), but since it could explain some of the short analyzer sessions, it's worth some investigation.

Activity

  1. FMorschel commented on Dec 10, 2025

    @FMorschel
    Contributor

    If I'm understanding the issue correctly: something to have in mind would be auto-save on delay. If people are changing their configs inside a workspace configuration file that may be triggering this multiple times(?).

  2. DanTup commented on Dec 10, 2025

    @DanTup
    MemberAuthor

    True, we but only fire if the specific values above have changed - so even if someone was typing a new SDK path very slowly and it was auto-saving constantly, it should still be a fairly low number (it takes time for us to restart before we'd start monitoring again, and probably users aren't manually typing these settings very frequently).

    We could try adding a debounce, but since auto-save can be after a delay, I'm not sure it'd help much without the timeout being quite high.

  3. added this to the v3.126.0 milestone on Dec 10, 2025
  4. DanTup commented on Dec 15, 2025

    @DanTup
    MemberAuthor

    From the limited stats I have (opted-in pre-release users from over the weekend), the configuration changing is always flutterSdkPath and sdkPath. This made me wonder if there are other extensions that are providing some SDK-selection functionality.. I asked ChatGPT and Gemini to search and between them they found that both FVM and MSIE may be writing this setting:

    I don't know how many people use these or at which points they might write these settings. But if we find a managed version of flutter on PATH and then start flutter daemon, and that triggers it to write, then that could explain at least some of these.

    I'll try these out and see if I can trigger any behaviour like this.

  5. FMorschel commented on Dec 15, 2025

    @FMorschel
    Contributor

    Well, I'm not exactly sure how fvm or msie do this, but puro also does it. But it only changes when you actively write puro use myEnv on your terminal.

  6. DanTup commented on Dec 15, 2025

    @DanTup
    MemberAuthor

    If it requires a command, it's probably not the cause of the ones that happen < 1s after activation. I found that mise doesn't seem to be available for Windows, and half of the stats are Windows, so probably it's not that. I'm going to try out fvm and see whether that does this automatically.

  7. DanTup commented on Dec 15, 2025

    @DanTup
    MemberAuthor

    I did some testing of fvm, and it seems to also only write this file when you run fvm use (at least, that's all I could trigger, and reviewing the source seems to only call this from the "use" path). So maybe it's not that either.

  8. FMorschel commented on Dec 15, 2025

    @FMorschel
    Contributor

    Maybe you could add a temporary toast to pre-release and trigger it for users when that happens? Like "Your SDK just changed" and ask for their help in what tools they use or something?

  9. DanTup commented on Dec 15, 2025

    @DanTup
    MemberAuthor

    Yeah, I was thinking about something like that (if pre-release, it happens after < 1s, and you didn't interact with the built-in SDK manager). I'll wait for a little more data first though in case any patterns show up (the sample so far is only around 15 users so my assumption that it's only the sdk path might not hold true).

  10. modified the milestones: v3.126.0, v3.128.0 on Dec 29, 2025
  11. modified the milestones: v3.128.0, v3.130.0 on Jan 29, 2026
  12. modified the milestones: v3.130.0, v3.132.0 on Feb 26, 2026
  13. modified the milestones: v3.132.0, v3.134.0 on Mar 23, 2026
  14. modified the milestones: v3.134.0, v3.136.0 on Apr 20, 2026
  15. modified the milestones: v3.136.0, v3.138.0 on May 27, 2026
  16. modified the milestones: v3.138.0, v3.140.0 on Jun 25, 2026
  17. modified the milestones: v3.140.0, On Deck on Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions