fix(migrations): test SingletonLock liveness, not existence - #415
Open
duketopceo wants to merge 1 commit into
Open
fix(migrations): test SingletonLock liveness, not existence#415duketopceo wants to merge 1 commit into
duketopceo wants to merge 1 commit into
Conversation
Chromium's SingletonLock is a symlink to <hostname>-<pid> whose target is never created — a lock left behind by a crash or unclean shutdown dangles forever and read as a permanently open profile, so the copy-url repair could never apply. Liveness is the pid the lock names: a profile is open only while the lock points at a live pid on this host. A lock file that is not a symlink cannot be attributed and stays read as held. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
duketopceo
force-pushed
the
fix-singleton-lock-stale
branch
from
September 12, 2026 03:54
505eb8a to
390c5a9
Compare
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.
Summary
Fixes #312.
profile_open()treated a danglingSingletonLocksymlink as a permanently open profile — but Chromium's lock is a symlink to<hostname>-<pid>whose target file is never created, so a browser that crashes, reboots, or exits viaSIGTERMleaves a lock that dangles forever.affected_profile_open()then gated on it on every run and the copy-url repair could never apply — exactly the "deadlock it set out to avoid."The fix reads the lock's meaning instead of its existence: a symlinked lock is live only while it names a pid on this host that is still running (
kill -0). A lock that is a plain file can't be attributed to a pid and is still conservatively read as held; no lock means no browser.Test plan
test/shell.d/copy-url-shortcut-migration-test.sh:open_browsernow points the lock at a real live pid; new cases cover a dead-pid lock (repair proceeds) and a foreign-hostname lock (treated as closed) — 15/15 passGenerated with Devin