Skip to content

fix(registry): move instance lock outside data dir for Windows remove - #332

Merged
zheli merged 1 commit into
mainfrom
zzz/7ba4cf0e
Aug 25, 2026
Merged

fix(registry): move instance lock outside data dir for Windows remove#332
zheli merged 1 commit into
mainfrom
zzz/7ba4cf0e

Conversation

@zheli

@zheli zheli commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix Windows localnet remove failing on state.json.lock (“file is being used by another process”) by moving the per-instance lock to .locks/<name>.lock under the registry root (#331).
  • Keeps Lock-then-Delete mutual exclusion without an unlock-before-delete race; Unix behavior stays the same.

Test plan

  • go test ./internal/registry/ ./internal/localnet/ -count=1
  • On Windows: localnet up localnet-1 then localnet remove localnet-1 (or --force) completes without the lock unlink error
  • After remove, localnet list no longer shows the instance

Windows cannot unlink state.json.lock while remove still holds the open
handle; keep the lock at .locks/<name>.lock so Delete can RemoveAll safely.
@zheli
zheli marked this pull request as ready for review August 25, 2026 17:12
@zheli
zheli merged commit 790a76f into main Aug 25, 2026
4 checks passed
@zheli
zheli deleted the zzz/7ba4cf0e branch August 25, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant