Install and update fail at the end with "Another editor is changing this profile" since Longshot nightly-1179 #426

Open
opened 2026-12-05 20:02:20 +00:00 by llun · 1 comment
Member

Since Longshot nightly-1179, every Launcher install or update fails at its last step with "Another editor is changing this profile. Try again in a moment." Retrying fails the same way.

What a player saw

An update from nightly-981 to nightly-1179 with Launcher nightly-277:

16:52:24.804    stdout    {"v":1,"type":"log","text":"fast check: current (4.0 ms)", ...}
16:52:24.804    stdout    {"v":1,"type":"done","folder":"<build destination>\\builds\\default","seconds":0.0, ...}
16:52:24.856    launcher    [INFO] Registering the installation
16:52:26.873    launcher    [ERROR] Another editor is changing this profile. Try again in a moment.

The 2-second gap is the Launcher's lock wait. (fast check: current only means an earlier attempt had built 1179 already.)

Cause

The Launcher and Longshot's builder share <profile>/.longshot-edit.lock, but since today they follow different rules:

  • Builder, since MagicBeanDev/Longshot#3020 (merged 2026-12-05, first in nightly-1179): an operating-system lock on the file (File::try_lock). The file is created when missing and left in place, empty, after the lock is released (builder/crates/launcher-profile/src/edit.rs). Every longshot-builder build --profile takes it, because play::ensure_built first calls modtool::record_mods, which edits the profile.
  • Launcher (nightly-277 and main 48e2d12): src/players/profiles.rs EditLock::take treats "the file exists" as "held", and only moves it aside when its second word is a time more than 30 seconds old. An empty file has no time, so it is never treated as stale: after 2 seconds, the error above.

During an install or update, the builder runs and leaves the empty file; about 50 ms later remember_build_options (src/game/wizard.rs) takes the profile's edit lock and fails. By then the build is in place and the version is registered under the new tag, but the build options, the game language follow, the settings patch and the cleanup of old builder downloads are skipped. Any other Launcher edit of that profile (save names, mods, language) fails the same way while the file is there, and every Play recreates it.

Fix

The Launcher takes the same operating-system lock as the builder: open .longshot-edit.lock (create it when missing), try_lock it for up to 2 seconds, leave the file in place. A file with no holder never keeps an edit out, and a crashed holder frees the lock when its process ends.

Workaround until then

Deleting .longshot-edit.lock in the profile folder (%LOCALAPPDATA%\LongshotLauncher\profiles\<profile>\ by default) lets the Launcher's edits through until the builder runs again. It does not help a retried update, since the builder recreates the file just before the Launcher's step.

Since Longshot nightly-1179, every Launcher install or update fails at its last step with "Another editor is changing this profile. Try again in a moment." Retrying fails the same way. ## What a player saw An update from nightly-981 to nightly-1179 with Launcher nightly-277: ``` 16:52:24.804 stdout {"v":1,"type":"log","text":"fast check: current (4.0 ms)", ...} 16:52:24.804 stdout {"v":1,"type":"done","folder":"<build destination>\\builds\\default","seconds":0.0, ...} 16:52:24.856 launcher [INFO] Registering the installation 16:52:26.873 launcher [ERROR] Another editor is changing this profile. Try again in a moment. ``` The 2-second gap is the Launcher's lock wait. (`fast check: current` only means an earlier attempt had built 1179 already.) ## Cause The Launcher and Longshot's builder share `<profile>/.longshot-edit.lock`, but since today they follow different rules: - **Builder**, since https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/3020 (merged 2026-12-05, first in nightly-1179): an operating-system lock on the file (`File::try_lock`). The file is created when missing and **left in place, empty**, after the lock is released (`builder/crates/launcher-profile/src/edit.rs`). Every `longshot-builder build --profile` takes it, because `play::ensure_built` first calls `modtool::record_mods`, which edits the profile. - **Launcher** (nightly-277 and `main` 48e2d12): `src/players/profiles.rs` `EditLock::take` treats "the file exists" as "held", and only moves it aside when its second word is a time more than 30 seconds old. An empty file has no time, so it is never treated as stale: after 2 seconds, the error above. During an install or update, the builder runs and leaves the empty file; about 50 ms later `remember_build_options` (`src/game/wizard.rs`) takes the profile's edit lock and fails. By then the build is in place and the version is registered under the new tag, but the build options, the game language follow, the settings patch and the cleanup of old builder downloads are skipped. Any other Launcher edit of that profile (save names, mods, language) fails the same way while the file is there, and every Play recreates it. ## Fix The Launcher takes the same operating-system lock as the builder: open `.longshot-edit.lock` (create it when missing), `try_lock` it for up to 2 seconds, leave the file in place. A file with no holder never keeps an edit out, and a crashed holder frees the lock when its process ends. ## Workaround until then Deleting `.longshot-edit.lock` in the profile folder (`%LOCALAPPDATA%\LongshotLauncher\profiles\<profile>\` by default) lets the Launcher's edits through until the builder runs again. It does not help a retried update, since the builder recreates the file just before the Launcher's step.
Member

This looks like a valid bug report. I couldn't locate the cause in the code.

The launcher code supports the reported failure: an empty .longshot-edit.lock prevents profile edits and produces the quoted error after two seconds. This can stop installation finalization after the version has been registered. The builder code is not in this checkout, so I could not verify that nightly-1179 creates and leaves the empty file, or that every build and Play does so.


For maintainers

Checked Launcher src/players/profiles.rs lines 98–132: EditLock::take uses persist_noclobber, reads a PID/timestamp record to detect stale locks, and emits the quoted error after a two-second deadline. Longshot builder builder/crates/launcher-profile/src/edit.rs documents OS advisory locking via File::try_lock; the report identifies the lock file remaining empty after release. Report cites Longshot PR #3020 as introducing the builder change and nightly-1179 as its first release.

The lock implementation is unchanged between launcher tag nightly-277-cd9aad02 and HEAD. Blame attributes it to commit 5932797. Check the builder change in Longshot PR #3020 and coordinate the shared locking protocol there; this checkout does not contain the builder implementation.

Seen in the code:

  • src/players/profiles.rs:105 — The launcher uses .longshot-edit.lock and attempts to create it without overwriting an existing file.
  • src/players/profiles.rs:118 — An existing file is considered stale only if its second field is a parseable timestamp over 30 seconds old; an empty file cannot meet that condition.
  • src/players/profiles.rs:130 — The launcher returns the reported error when the two-second deadline expires.
  • src/game/wizard.rs:696 — Version registration precedes remember_build_options; an error there skips the subsequent cleanup.
  • src/game/wizard.rs:733 — remember_build_options takes the profile edit lock before updating the profile, language and settings.
  • src/players/profiles.rs:168 — Other profile edits using with_edit_lock encounter the same lock behavior.

Automated triage by BeanBot (gpt-6-luna). Nothing was run; a maintainer decides.

**This looks like a valid bug report.** I couldn't locate the cause in the code. The launcher code supports the reported failure: an empty `.longshot-edit.lock` prevents profile edits and produces the quoted error after two seconds. This can stop installation finalization after the version has been registered. The builder code is not in this checkout, so I could not verify that nightly-1179 creates and leaves the empty file, or that every build and Play does so. --- **For maintainers** Checked Launcher `src/players/profiles.rs` lines 98–132: `EditLock::take` uses `persist_noclobber`, reads a PID/timestamp record to detect stale locks, and emits the quoted error after a two-second deadline. Longshot builder `builder/crates/launcher-profile/src/edit.rs` documents OS advisory locking via `File::try_lock`; the report identifies the lock file remaining empty after release. Report cites Longshot PR #3020 as introducing the builder change and nightly-1179 as its first release. The lock implementation is unchanged between launcher tag `nightly-277-cd9aad02` and HEAD. Blame attributes it to commit `5932797`. Check the builder change in Longshot PR #3020 and coordinate the shared locking protocol there; this checkout does not contain the builder implementation. Seen in the code: - src/players/profiles.rs:105 — The launcher uses `.longshot-edit.lock` and attempts to create it without overwriting an existing file. - src/players/profiles.rs:118 — An existing file is considered stale only if its second field is a parseable timestamp over 30 seconds old; an empty file cannot meet that condition. - src/players/profiles.rs:130 — The launcher returns the reported error when the two-second deadline expires. - src/game/wizard.rs:696 — Version registration precedes `remember_build_options`; an error there skips the subsequent cleanup. - src/game/wizard.rs:733 — `remember_build_options` takes the profile edit lock before updating the profile, language and settings. - src/players/profiles.rs:168 — Other profile edits using `with_edit_lock` encounter the same lock behavior. --- <sub>Automated triage by BeanBot (gpt-6-luna). Nothing was run; a maintainer decides.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher#426
No description provided.