sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
809 stars 39 forks source link

Open folder is infinitely re-indexed after installing many packages #6068

Closed deathaxe closed 1 year ago

deathaxe commented 1 year ago

Description of the bug

Recently ran into a situation, when ST restarts indexing again and again until closing.

The issue can reliable be reproduced, if

  1. two ST windows are open, with one of them showing ST's preferences
  2. ST's Data/ folder being open in sidebar
  3. and many packages being installed and enabled in a batch.

Packages are installed via PC4.0-beta5 as 3.4.1 fails epically on such a task.

PC4.0 ...

  1. disables all packages via ignored_packages setting
  2. downloads all sublime-package files into Data/Installed Packages
  3. re-enables all packages by clearing ignored_packages setting

So all packages are loaded together in a single batch.

Steps to reproduce

  1. Create a vanilla ST portable setup

  2. Start ST

  3. Install Package Control

  4. Upgrade to Package Control 4.0-beta5

    4.1. Run Preferences: Package Control Settings

    4.2. Add the following to the right pane and save it.

    "install_prereleases": [
        "Package Control"
    ],

    4.3 Run: Package Control: Upgrade Packages/Overwrite all

    4.4. Restart ST to be sure everything is bootstrapped after PC upgrade

  5. Open portable ST's Data/ folder

  6. Run Preferences: Package Control Settings (again)

  7. Paste "installed_packages" [...] content from Additional Information > Package Control.sublime-settings to the right, save and close it.

  8. Run: Preferences: Settings, so 2 windows are open

  9. Restart ST again (!! Use: Main Menu > File > Exit Sublime Text !!)

Expected behavior

ST starts with 2 windows (empty one and Preferences) open, installs all missing packages and re-indexes open folders once after packages have been installed.

Actual behavior

ST starts with 2 windows (empty one and Preferences) open, installs all missing packages and re-indexes open folders repetitivly until app is restarted.

Note

It seems to be important that at least 2 windows are open with one of them displaying ST's Preferences.sublime-settings.

Sublime Text build number

4150

Operating system & version

Windows 11

(Linux) Desktop environment and/or window manager

No response

Additional information

Package Control.sublime-settings

```json { "installed_packages": [ "A File Icon", "Alignment", "AlignTab", "ApacheConf", "ApplySyntax", "ayu", "Better CoffeeScript", "Brackets Color Scheme", "CMake", "CNC Sinumerik", "ColorHelper", "Column Select", "Containerfile", "DoxyDoxygen", "EasyDiff", "EditorConfig", "ExpandRegion", "Folder Aliaser", "FuzzyFileNav", "GitGutter", "GitSavvy", "GraphQL", "INI", "Insert Nums", "Inspired GitHub Color Scheme", "JSCustom", "Less", "Liquid", "LSP", "LSP-angular", "LSP-bash", "LSP-css", "LSP-file-watcher-chokidar", "LSP-html", "LSP-intelephense", "LSP-jdtls", "LSP-json", "LSP-OmniSharp", "LSP-PowerShellEditorServices", "LSP-pyright", "LSP-tailwindcss", "Markdown Images", "MarkdownEditing", "MarkdownPreview", "MaxPane", "MonokaiFree", "More Layouts", "MultiEditUtils", "nginx", "Ngx HTML", "Object Pascal", "Package Control", "PackageDev", "PackageResourceViewer", "Paste As Column", "PlainTasks", "PostgreSQL Syntax Highlighting", "PowerShell", "ProjectManager", "python-black", "ReadmePlease", "requirementstxt", "Sass", "SmarterLineMoves", "SmartMarkdown", "Solarized Color Scheme", "StringUtilities", "SublimeLinter", "Svelte", "SVGO", "Tab Filter", "Taskfile", "Theme - Afterglow", "Theme - Alpenglow", "Theme - DAneo", "TOML", "Tron Color Scheme", "UnicodeCompletion", "UnitTesting", "Vue Syntax Highlight", "WslBuild", "x86 and x86_64 Assembly", "YAMLMacros", ], "install_prereleases": [ "Package Control" ], } ```

Indexer Status

``` indexing [job 1]: spawning 5 workers to process 5757 files indexing [job 1]: indexed 4652 files in 2.60979s index "" collated in 3.4e-06s from 0 files index "" is using 0 bytes for 0 symbols across 0 locations indexing [job 2]: spawning 5 workers to process 6129 files indexing [job 2]: indexed 6129 files in 3.7329s index "Data" collated in 0.051s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 3]: spawning 5 workers to process 6129 files indexing [job 3]: indexed 6129 files in 3.50594s index "Data" collated in 0.046s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 4]: spawning 5 workers to process 6129 files indexing [job 4]: indexed 6129 files in 3.49187s index "Data" collated in 0.046s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 5]: spawning 5 workers to process 6129 files indexing [job 5]: indexed 6129 files in 3.47996s index "Data" collated in 0.045s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 6]: spawning 5 workers to process 6129 files indexing [job 6]: indexed 6129 files in 3.49998s index "Data" collated in 0.045s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 7]: spawning 5 workers to process 6129 files indexing [job 7]: indexed 6129 files in 3.53539s index "Data" collated in 0.046s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 8]: spawning 5 workers to process 6129 files indexing [job 8]: indexed 6129 files in 3.50054s index "Data" collated in 0.048s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 9]: spawning 5 workers to process 6129 files indexing [job 9]: indexed 6129 files in 3.64319s index "Data" collated in 0.047s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 10]: spawning 5 workers to process 6129 files indexing [job 10]: indexed 6129 files in 3.62668s index "Data" collated in 0.053s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 11]: spawning 5 workers to process 6129 files indexing [job 11]: indexed 6129 files in 3.65982s index "Data" collated in 0.047s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 12]: spawning 5 workers to process 6129 files indexing [job 12]: indexed 6129 files in 3.59023s index "Data" collated in 0.045s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 13]: spawning 5 workers to process 6129 files indexing [job 13]: indexed 6129 files in 3.60932s index "Data" collated in 0.047s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 14]: spawning 5 workers to process 6129 files indexing [job 14]: indexed 6129 files in 3.57083s index "Data" collated in 0.047s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 15]: spawning 5 workers to process 6129 files indexing [job 15]: indexed 6129 files in 3.57278s index "Data" collated in 0.045s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 16]: spawning 5 workers to process 6129 files indexing [job 16]: indexed 6129 files in 3.57953s index "Data" collated in 0.045s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 17]: spawning 5 workers to process 6129 files indexing [job 17]: indexed 6129 files in 3.56948s index "Data" collated in 0.047s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 18]: spawning 5 workers to process 6129 files indexing [job 18]: indexed 6129 files in 3.53496s index "Data" collated in 0.048s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 19]: spawning 5 workers to process 6129 files indexing [job 19]: indexed 6129 files in 3.55108s index "Data" collated in 0.046s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 20]: spawning 5 workers to process 6129 files indexing [job 20]: indexed 6129 files in 3.5797s index "Data" collated in 0.048s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 21]: spawning 5 workers to process 6129 files indexing [job 21]: indexed 6129 files in 3.5961s index "Data" collated in 0.048s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 22]: spawning 5 workers to process 6129 files indexing [job 22]: indexed 6129 files in 3.59114s index "Data" collated in 0.045s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 23]: spawning 5 workers to process 6129 files indexing [job 23]: indexed 6129 files in 3.59344s index "Data" collated in 0.049s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 24]: spawning 5 workers to process 6129 files indexing [job 24]: indexed 6129 files in 3.71021s index "Data" collated in 0.049s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 25]: spawning 5 workers to process 6129 files indexing [job 25]: indexed 6129 files in 3.64014s index "Data" collated in 0.047s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 26]: spawning 5 workers to process 6129 files indexing [job 26]: indexed 6129 files in 3.60395s index "Data" collated in 0.048s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 27]: spawning 5 workers to process 6129 files indexing [job 27]: indexed 6129 files in 3.62588s index "Data" collated in 0.047s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 28]: spawning 5 workers to process 6129 files indexing [job 28]: indexed 6129 files in 3.71834s index "Data" collated in 0.058s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 29]: spawning 5 workers to process 6129 files indexing [job 29]: indexed 6129 files in 3.65457s index "Data" collated in 0.046s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 30]: spawning 5 workers to process 6129 files indexing [job 30]: indexed 6129 files in 3.65822s index "Data" collated in 0.049s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 31]: spawning 5 workers to process 6129 files indexing [job 31]: indexed 6129 files in 3.68172s index "Data" collated in 0.05s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 32]: spawning 5 workers to process 6129 files indexing [job 32]: indexed 6129 files in 3.76585s index "Data" collated in 0.051s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 33]: spawning 5 workers to process 6129 files indexing [job 33]: indexed 6129 files in 3.65841s index "Data" collated in 0.045s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 34]: spawning 5 workers to process 6129 files indexing [job 34]: indexed 6129 files in 3.60877s index "Data" collated in 0.046s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 35]: spawning 5 workers to process 6129 files indexing [job 35]: indexed 6129 files in 3.64304s index "Data" collated in 0.048s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 36]: spawning 5 workers to process 6129 files indexing [job 36]: indexed 6129 files in 3.60768s index "Data" collated in 0.05s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 37]: spawning 5 workers to process 6129 files indexing [job 37]: indexed 6129 files in 3.61733s index "Data" collated in 0.047s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 38]: spawning 5 workers to process 6129 files indexing [job 38]: indexed 6129 files in 3.63285s index "Data" collated in 0.047s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 39]: spawning 5 workers to process 6129 files indexing [job 39]: indexed 6129 files in 3.65942s index "Data" collated in 0.047s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 40]: spawning 5 workers to process 6129 files indexing [job 40]: indexed 6129 files in 3.65124s index "Data" collated in 0.048s from 6129 files index "Data" is using 2486272 bytes for 43583 symbols across 178848 locations indexing [job 41]: spawning 5 workers to process 6129 files ```

OpenGL context information

No response

BenjaminSchaaf commented 1 year ago

I can't reproduce this in build 4160. After restarting ST package control installs a whole bunch of stuff, resulting in syntaxes changes and thus recrawls but as soon as the packages are done making file changes ST completes the crawl and idles.

It could be that the recent index changes inadvertently fixed this.

``` indexing [job 1]: spawning 1 workers to process 1 files indexing [job 1]: indexed 1 files in 1.75389s index "sublime-text-development" collated in 0.0033s from 2 files index "sublime-text-development" is using 1580 bytes for 16 symbols across 86 locations indexing [job 2]: spawning 1 workers to process 2 files indexing [job 2]: indexed 2 files in 1.24445s index "sublime-text-development" updated in 0.00016s with 2 new and 0 removed files index "sublime-text-development" is using 1580 bytes for 16 symbols across 86 locations index "" collated in 2e-05s from 0 files index "" is using 0 bytes for 0 symbols across 0 locations indexing [job 3]: spawning 16 workers to process 1663 files indexing [job 3]: indexed 16 files in 7.96879s index "" collated in 1.4e-05s from 0 files index "" is using 0 bytes for 0 symbols across 0 locations indexing [job 4]: spawning 16 workers to process 1705 files indexing [job 4]: indexed 525 files in 12.8566s index "" collated in 1.9e-05s from 0 files index "" is using 0 bytes for 0 symbols across 0 locations indexing [job 5]: spawning 16 workers to process 1840 files indexing [job 5]: indexed 16 files in 3.32167s index "" collated in 1.8e-05s from 0 files index "" is using 0 bytes for 0 symbols across 0 locations indexing [job 6]: spawning 16 workers to process 1984 files indexing [job 6]: indexed 16 files in 3.04334s index "" collated in 1.8e-05s from 0 files index "" is using 0 bytes for 0 symbols across 0 locations indexing [job 7]: spawning 16 workers to process 1984 files worker 11 pid:615050 appears stuck while processing file /home/benjamin/.config/sublime-text-development/Lib/python33/bracex-2.1.1.dist-info/LICENSE.md, killing process and restarting worker indexing [job 7]: indexed 1984 files in 31.7473s index "sublime-text-development" collated in 0.5s from 1647 files index "sublime-text-development" is using 1372711 bytes for 8977 symbols across 84045 locations index "sublime-text-development" collated in 0.42s from 1647 files index "sublime-text-development" is using 1372711 bytes for 8977 symbols across 84045 locations indexing [job 9]: spawning 1 workers to process 2 files indexing [job 9]: indexed 2 files in 5.49616s index "sublime-text-development" updated in 0.0019s with 2 new and 0 removed files index "sublime-text-development" is using 1372711 bytes for 8977 symbols across 84045 locations indexing [job 10]: spawning 1 workers to process 1 files indexing [job 10]: indexed 1 files in 6.07351s index "sublime-text-development" updated in 0.00013s with 1 new and 0 removed files index "sublime-text-development" is using 1372711 bytes for 8977 symbols across 84045 locations ```
deathaxe commented 1 year ago

Seems indeed to be fixed. Can't reproduce it with 4160 as well.