microsoft / microsoft/vscode

VS Code Snap leaves processes running after exit and blocks updates

Open
#331,750 1 comment 5 reactions 1 assignee Claimed by @deepak1556 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Does this issue occur when all extensions are disabled?: Yes

- VS Code Version: 1.134.0 (Snap revision 258)
- OS Version: Ubuntu 24.04.4 LTS, amd64, X11

* Installation: official `code` Snap, `latest/stable`, classic confinement

### Steps to Reproduce:

1. Ensure no stale VS Code Snap scope is running.
2. Launch VS Code with all extensions disabled:

code --disable-extensions

3. Close VS Code normally.
4. Run:

systemctl --user list-units 'snap.code.code-*.scope'

5. Run:

pgrep -af 'chrome_crashpad_handler|dconf watch /system/proxy/'

### Actual behavior:

After VS Code 1.134.0 (Snap revision 258) was launched with
`code --disable-extensions` and then closed normally, its Snap scope
remained active:

snap.code.code-d8bde8df-5c41-445b-9f80-f2322684d880.scope
loaded active running

The following VS Code-related processes also remained:

17000 /snap/code/258/usr/share/code/chrome_crashpad_handler ...
17204 dconf watch /system/proxy/

Both chrome_crashpad_handler and dconf watch /system/proxy/ remain in the active snap.code.code-*.scope after VS Code exits.

Therefore this reproduces with all extensions disabled.

When a Snap update is pending, these surviving processes cause snapd to
consider VS Code still running and postpone/refuse the refresh.

Stopping the stale snap.code.code-*.scope manually allows the pending
refresh to proceed.

### Expected behavior

After the last VS Code window is closed, VS Code-related helper processes should terminate and the `snap.code.code-*.scope` should disappear, allowing snapd to refresh VS Code normally.

### Workaround

Stopping the stale scope allows the pending update to proceed immediately:

```bash
systemctl --user list-units --type=scope --state=running --no-legend 'snap.code.code-*.scope' \
| awk '{print $1}' \
| xargs -r systemctl --user stop
```

After doing this, the pending VS Code Snap update completes successfully.

This has reproduced across multiple VS Code Snap revisions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.