Repository navigation
feat(dot): add --lock-wait for a running history operation #15473
zachbornheimer
started this conversation in
Ideas
Replies: 1 comment
|
Implemented in #15498: feat(dot): add history.lock_wait to wait longer for a running history operation |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
GitHub will not let me open a pull request on this repository, so the patch is on a branch:
https://github.com/zachbornheimer/mise/tree/dot-lock-wait
Compare: main...zachbornheimer:mise:dot-lock-wait
Motivation
A mutating
mise dotcommand already waits 30 seconds for the history operation lock, then fails withanother history operation is running. A script that needs its own checkpoint, with a description, label, or task id, has to retry in a shell loop. The watcher will record an unlabeled change, but it will not record the checkpoint the command asked for.Changes
mise dot --lock-wait <duration>andMISE_HISTORY_LOCK_WAITset that wait for this process.0fails at once. Longer than 1 hour is refused. The wait stays insideacquire_operation_lock, so the command takes the lock itself instead of polling and then racing the watcher.crates/mise-system/src/history/scope.rs—operation_lock_wait()replaces the 30-second constant inbegin_kind,take_operation_lock, and the late journal open. Callers that pass zero (begin_automatic_apply,recovery_lock) do not read it.src/cli/dotfiles/mod.rs— the flag.watchandrecoverignore it and warn, so an exportedMISE_HISTORY_LOCK_WAITdoes not stall the watcher.docs/dotfiles/reference.md— the history lock section.Not included: a bare
--waitthat means forever, and making the watcher or recovery wait.Testing
cargo test -p mise -p mise-system --lib configured_lock_wait_is_honored_and_zero_callers_are_not— the override waits until the holder releases,0fails at once, andrecovery_lockstill does not wait. Passed.cargo check -p mise --bin mise— the flag compiles. Passed.Untested: the generated CLI pages.
mise usagedid not finish locally, sodocs/cli/andmise.usage.kdlare unchanged.All reactions