pidlock.Acquire reads the PID file, checks whether that process is alive, and then writes its own PID with os.WriteFile (internal/pidlock/pidlock.go:46-58). There is no O_EXCL and no flock. Two invocations started at the same instant can both pass the check and both run: duplicate cron lines, or a timer plus a manual run. README.md:187-190 says only one writer runs at a time, "so two writers can never corrupt the local index or the destination store". This is traced on next at 0700901, not reproduced as a race.
Definition of done
Acquiring the lock is atomic: an OS file lock (flock) held for the life of the process, or creation with O_EXCL plus the existing liveness check for a stale file.
A test holds the lock and asserts that a second Acquire fails while the first is held, and that it succeeds after release.
make check passes.
Model: fable-5-1 (audit); opus-5-5 (issue)
`pidlock.Acquire` reads the PID file, checks whether that process is alive, and then writes its own PID with `os.WriteFile` (`internal/pidlock/pidlock.go:46-58`). There is no `O_EXCL` and no `flock`. Two invocations started at the same instant can both pass the check and both run: duplicate cron lines, or a timer plus a manual run. `README.md:187-190` says only one writer runs at a time, "so two writers can never corrupt the local index or the destination store". This is traced on `next` at `0700901`, not reproduced as a race.
## Definition of done
1. Acquiring the lock is atomic: an OS file lock (`flock`) held for the life of the process, or creation with `O_EXCL` plus the existing liveness check for a stale file.
2. A test holds the lock and asserts that a second `Acquire` fails while the first is held, and that it succeeds after release.
3. `make check` passes.
Model: fable-5-1 (audit); opus-5-5 (issue)
clawbot
self-assigned this 2026-10-06 01:49:46 +02:00
The defect reproduced on next at cdc60c4: a test that starts many Acquire calls together got more than one lock. #258 makes the lock an flock on vaultik.pid, held for the whole run.
Model: opus-5-5
The defect reproduced on `next` at `cdc60c4`: a test that starts many `Acquire` calls together got more than one lock. https://git.eeqj.de/sneak/vaultik/pulls/258 makes the lock an `flock` on `vaultik.pid`, held for the whole run.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
pidlock.Acquirereads the PID file, checks whether that process is alive, and then writes its own PID withos.WriteFile(internal/pidlock/pidlock.go:46-58). There is noO_EXCLand noflock. Two invocations started at the same instant can both pass the check and both run: duplicate cron lines, or a timer plus a manual run.README.md:187-190says only one writer runs at a time, "so two writers can never corrupt the local index or the destination store". This is traced onnextat0700901, not reproduced as a race.Definition of done
flock) held for the life of the process, or creation withO_EXCLplus the existing liveness check for a stale file.Acquirefails while the first is held, and that it succeeds after release.make checkpasses.Model: fable-5-1 (audit); opus-5-5 (issue)
The defect reproduced on
nextatcdc60c4: a test that starts manyAcquirecalls together got more than one lock. #258 makes the lock anflockonvaultik.pid, held for the whole run.Model: opus-5-5