Studio: Fix site deletion lock contention for multiple deletions - #2492
Merged
epeicher merged 3 commits intoJan 28, 2026
Merged
Conversation
…iple sites Remove appdata locking from the main process deleteSite handler. The CLI process already handles appdata updates with proper locking, so the main process locking was redundant and caused lock contention issues. When deleting multiple sites, the main process would hold the lock while spawning CLI processes that also needed the same lock, causing race conditions and EEXIST errors in the lockfile package's stale-lock recovery mechanism.
…sure-it-is-possible-to-delete-multiple-sites-in-succession
Collaborator
📊 Performance Test ResultsComparing 7424f58 vs trunk site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change |
…sure-it-is-possible-to-delete-multiple-sites-in-succession
epeicher
deleted the
stu-1266-ensure-it-is-possible-to-delete-multiple-sites-in-succession
branch
January 28, 2026 18:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
Root Cause
When deleting a site, both the main process and CLI tried to lock and update the same
appdata-v1.json.lockfile:Main process acquires lock → spawns CLI
CLI tries to acquire the same lock → blocked
CLI waits 5 seconds for lock to become "stale", then takes over
Single site: Hidden 5-second delay on every deletion
Multiple sites: Race condition when multiple processes try to take over the stale lock simultaneously → EEXIST errors → deletion failures
Proposed Changes
deleteSitehandlerTesting Instructions
studiocli for that by moving to~/Studiofolder and running:Pre-merge Checklist