sublimehq / sublime_text

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

Unable to update Sublime, blocked by plugin-host #5754

Open xwang186 opened 1 year ago

xwang186 commented 1 year ago

Description of the bug

Exactly the same behavior as Unable to rename Sublime text 3 to Sublime text 3(xxx), it is being used by another process

That issue is fixed by a Windows update; but this issue is a different situation.

In the application, when I click download updates, the download is fine; when I am going to install it, it kills the Sublime process and after a while with the error msg as Unable to rename Sublime text 3 to Sublime text 3(xxx), it is being used by another process

I found out that this is because one of my plug-in processes is not killed. image

When I uninstalled the package, the installation in the application worked fine.

Steps to reproduce

  1. Have an old version of sublime installed
  2. ctrl shift p -> Install package -> JsonComma -> Enter
  3. reboot Sublime
  4. Click on "Check for updates"
  5. Download & Install

Expected behavior

The update of Sublime works fine. Exiting Sublime kills all the sub processes including plugin-host.

Actual behavior

Error msg window

Sublime Text build number

any

Operating system & version

Windows 11

(Linux) Desktop environment and/or window manager

No response

Additional information

No response

OpenGL context information

No response

deathaxe commented 1 year ago

That's interesting as up to that point Anti Virus programs have been blamed to prevent write access to parts of ST. It turns out the installer would somehow need to make sure to kill all sub processes, if they don't exit on their own.

BenjaminSchaaf commented 1 year ago

This is caused by a bug in the jsoncomma plugin. Child processes must be terminated when the parent exits, otherwise file handles to the parent process will stay open on windows. The plugin completely leaks the jsoncomma server. We're looking at changing our update installer to better handle this situation.