Skip to content

(macos) Analyzer sometimes stops responding in VSCode when mass file change events occur #45996

Description

@acoutts

I've been dming @DanTup for a couple of weeks about this issue (first reported here: Dart-Code/Dart-Code#3295

After tons and tons of testing to narrow things down it seems like when you have a large project open and there's an event which triggers a ton of file changes at once, the analyzer stops responding in vscode and never recovers from its analyzing state.

I cannot reliably reproduce the issue, but i've narrowed down to it sometimes can occur while doing the following:

  • switch git branches
  • flutter clean
  • flutter run
  • flutter pub get
  • adding/removing a folder from the vscode workspace

These seem to cause a lot of file changes and sometimes (quite often) results in the analyzer not recovering. To fix it you have to stop your debug session, restart the analyzer, and do a full build again to start over. It has been quite annoying and some others are noticing it too (cc @lukepighetti).

I tried adding the ios and .git folders to dart.analysisExcludedFolders but it had no effect.

@DanTup mentioned there was a similar issue in windows related to file watchers and he suspected it could be the same issue affecting macos here too.

In all cases everyone I know that has experienced the issue has been running macos. In all of my affected instances i'm running an iOs build (both simulator and physical device are the same effect). All of my affected systems have quite high specs in terms of disk speed.

My affected systems:

  • M1 macbook pro (16gb ram model)
  • Hackintosh desktop (i7 9700k, 64gb ram, NVMe)

I created a test project here with a large number of dart files (10,000) to try and reproduce the issue:
https://github.com/acoutts/dart-crash-issue

But in testing that project alone won't break things. I have to add my (large) app to the vscode workspace and that's when the issues start. The only changes I can think of between these are my project has more packages (more pods maybe - larger iOS folder) and a huge git history (800mb+ .git folder, using LFS as well).

Dart SDK version: 2.14.0-74.0.dev (dev) (Mon May 3 05:56:14 2021 -0700) on "macos_x64"
Flutter 2.3.0-2.0.pre.89 • channel master • https://github.com/flutter/flutter.git
Framework • revision 6e08ea0a2c (2 days ago) • 2021-05-10 22:34:02 +0530
Engine • revision f5b97d0b23
Tools • Dart 2.14.0 (build 2.14.0-74.0.dev)
Version: 1.57.0-insider
Commit: 54d33cf14cf6c0e86880b5b74a5a3628de42bce9
Date: 2021-05-10T05:12:57.526Z (2 days ago)
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Darwin x64 20.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onanalyzer-stabilitydevexp-serverIssues related to some aspect of the analysis serverlegacy-area-analyzerUse area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions