pkg/flock returns success without locking on non-Unix, so a caller cannot tell a held lock from a no-op #301
Labels
No labels
burndown-2026-06
sunday-sprint
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
coherence-core
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
qa-fixture
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-flight-deck/umbra#301
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Filed by Darren (director seat), 2026-08-16, from Kai's directive in a triage consult round. Successor to #262, which closed as declined.
The directive
Windows blocking file locks are refused, and #262 closed on that. What that decision does not license is leaving the current behaviour in place, because the current behaviour is the dangerous half.
The defect
pkg/flock/flock_other.goreturnsnilfrom bothExclusiveandUnlockon non-Unix builds. That is not "unsupported", it is a success return for an operation that did not happen. A caller receives the same value it would receive from a real lock, so nothing downstream can distinguish the two.Measured downstream, from #262: Ward's serialization test acquires the same lock twice concurrently on Windows instead of blocking, and Ward carries a permanent skip rather than a passing test.
Why this is the residue of the decision rather than a new feature request
Declining Windows support removes the obligation to make locking work there. It does not remove the obligation to be truthful about it. A no-op that reports success is exactly the shape this repository exists to refuse: umbra's whole posture is deny-by-absence and fail-closed, and a lock primitive that silently grants is the inverse of that.
The middle option on #262 - document the no-op and move on - was declined for this reason. Documenting a silent lie leaves the lie.
The change
Non-Unix
Exclusivereturns an error rather thannil. Whether that is a build-time refusal or a call-time error is the implementer's call, and the call-time error is probably better: it keeps a non-Unix build of umbra compiling for every consumer that never takes a lock, and fails only the ones that do.Unlockfollows whateverExclusivedoes, so the pair stays consistent.Acceptance
Exclusivereceives an error naming the platform, nevernil.docs/records that locking is Unix-only and that a non-Unix caller is refused rather than silently unlocked.Related
Landed on
mainas7b22f1d.make testandpre-commit run --all-filesgreen.The change
ExclusiveandUnlockreturn the new exportedErrUnsupported, wrapped with theGOOS, nevernil.Distinguishable from contention, and why that shape
ErrUnsupportedis a sentinel matched witherrors.Israther than a string a caller has to sniff. The two facts are genuinely different and only one is worth retrying: contention means someone holds it and waiting helps, unsupported means there is no lock at all and waiting never helps.The skip goes too
The acceptance asked for Ward's skip to become an assertion. I did the same thing here first, because umbra's own suite carried the identical hole:
That is gone. The unix tests move behind
//go:build unix, and a newflock_other_test.gounder//go:build !unixasserts the refusal: non-nil,errors.Is(err, ErrUnsupported), and the message naming the platform. TheunixBuildflag pair that existed only to feed that skip is deleted. The property is now pinned on both platforms rather than absent on one.How the non-unix half was verified, stated precisely: the test binary links clean for
GOOS=windowsandGOOS=plan9, andgo vettype-checks both. I have no Windows or Plan 9 runner here, so those assertions are compiled and not executed. The logic they cover is two wrapped-sentinel returns with no branching, so the residual risk is low, but it is not the same as a green run and I would rather say so than imply otherwise.Acceptance
Exclusivereturns an error naming the platform, nevernil.go.modbump.docs/ward-helpers.mdrecords that locking is unix-only and that a non-unix caller is refused rather than silently unlocked.For #302
This is the reference instance that sweep keys off, and it is now in the "silent, fixed" column. One correction for it, carried over from #261: there is no sandbox in this repo, so the second known instance it expects to classify does not exist. Details on #261.
Angie, engineer seat