Lint cache follow-ups: same-checkout runs abort instead of queueing, and make clean leaves .lint-cache/ #130
Reference in New Issue
Block a user
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?
Non-blocking follow-ups from the review of PR #128. Neither affects correctness of that change; both are small and belong in one commit.
1. Two concurrent
make lintin the same checkout still abortPR #128 scopes
TMPDIRper checkout, which eliminates lock contention between checkouts — the dominant case. Within one checkout the lock is still shared, and golangci-lint aborts after its 5s timeout rather than waiting. Measured: two concurrentmake lintin one tree with a cold cache, one exitsrc=2withparallel golangci-lint is running.The realistic trigger is
script/precommitoverlapping amake check, which is not exotic.script/lint's comment currently claims the lock "serialis[es] runs that share one cache". It does not — it aborts.--allow-serial-runners(flagsets.go:59, consumed atrun.go:498to skip the timeout) is the flag that makes that sentence true: it keeps the mutual-exclusion guard and makes the second run queue.Note this is not
--allow-parallel-runners, which removes the guard entirely. PR #128's body and an earlier upstream comment of mine both wrongly described--allow-parallel-runnersas the only alternative; that has been corrected on prompts #30.2.
make cleandoes not remove.lint-cache/Makefile:43isrm -rf bin/. The new cache is ~80MB per checkout with no trimming, and this repo's agents work in throwaway worktrees, so it accumulates unboundedly.Definition of done
script/lintpasses--allow-serial-runnersso overlapping runs in one checkout queue rather than abort. Verify by launching two concurrentmake lintin a single checkout with a cold cache and confirming both exit 0 — the current behaviour is onerc=2, so this is a test that can fail.script/lintcomment describes what the lock now actually does.make cleanremoves.lint-cache/as well asbin/. Confirm amake lintfollowed bymake cleanleaves no.lint-cache/.script/lintstays POSIXsh(#!/bin/sh,set -eu, no bashisms);sh -nclean.../or outside its own tree.make checkgreen;TODO.mdupdated in the same commit.Commit title ends with
(closes #N).Constraints
.golangci.yml(sha256021cc83f4e6fc7c31b95b34b846723dfcf20b66b7baeea1dc40406e643346bcb) or the golangci-lint pin..lint-cache/to anything without a leading dot. The dot is load-bearing:TMPDIRlives inside the linted tree, and this is safe only because the Go tool skips dot-prefixed directories when expanding./.... A rename would silently feed the linter its own temp files. Add a comment saying so.Sequencing
Blocked until PR #128 merges — every line referenced here only exists on that branch.