beads/internal/linear/synclock_info_inline.go
ecuthiell db0787bb15
fix(linear): correlate Windows sync lock diagnostics (#4990)
Windows LockFileEx prevents contenders from reading inline owner metadata from the fully locked primary guard. Keep that guard as the sole lock authority and preserve the existing Unix path unchanged.

On Windows, publish a strict fixed-size owner record only after taking a random generation-specific byte lease on a stable sidecar handle. Contenders require an exact live process incarnation, shared lease probes, and a stable reread and reprobe before reporting details. Missing, stale, torn, mixed-version, or otherwise uncertain metadata remains generic and never authorizes reclaim.

Invalidate and release diagnostics before the primary guard, while making every sidecar failure best-effort. Cover shared-probe concurrency, stale-live and process-reuse defenses, crash phases, failure injection, open readers, and repeated handoffs.

Agent-Signature: codex-tui-gpt-5.6-sol-ultra on behalf of Ewen Cuthiell
2026-07-23 18:09:33 -07:00

23 lines
475 B
Go

//go:build !windows
package linear
import "os"
type syncLockMetadata struct{}
func syncLockMetadataPath(_ string, lockPath string) string {
return lockPath
}
func readContendedSyncLockInfo(path string) *SyncLockInfo {
return readLockInfo(path)
}
func publishSyncLockInfo(f *os.File, _ string) (syncLockMetadata, error) {
return syncLockMetadata{}, writeLockInfo(f)
}
func clearSyncLockInfo(f *os.File, _ string, _ *syncLockMetadata) error {
return f.Truncate(0)
}