mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 16:27:33 -10:00
fix(sshconfig): change known_hosts under its own lock
Pinning or forgetting a VM's host keys takes known_hosts.lock (an OS file lock, paths.Dirs.KnownHostsLock), reads the file again inside it and writes it whole with state.WriteFile, so two devvms at once lose neither's pin. ForgetHostKeys takes its caller's ctx. TestHostKeyConcurrent holds two pins' reads until both have read; it fails on the unlocked code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
9 files changed
+155
-22
No files matched your search
Vendored
+2
@@ -90,6 +90,7 @@ images/X/record.json
|
||||
images/locks
|
||||
images/locks/X
|
||||
known_hosts
|
||||
known_hosts.lock
|
||||
logs
|
||||
logs/runs
|
||||
logs/runs/X.log
|
||||
@@ -157,6 +158,7 @@ images/X/record.json
|
||||
images/locks
|
||||
images/locks/X
|
||||
known_hosts
|
||||
known_hosts.lock
|
||||
logs
|
||||
logs/runs
|
||||
logs/runs/X.log
|
||||
|
||||
Reference in new issue
Block a user