Repository navigation
perf(lint): isolate golangci-lint cache and lock per worktree - #2701
Conversation
Parallel worktree lints (rebase storms) serialized on golangci-lint's machine-global single-instance lock at $TMPDIR/golangci-lint.lock, and a run orphaned by a tool timeout froze every other worktree. Point TMPDIR and GOLANGCI_LINT_CACHE at repo-local dirs so each worktree gets its own lock and cache (GOCACHE stays shared for warm typecheck data), skip rebuilding custom-gcl when it is up to date, and drop the redundant standalone lintroller pass from `lint changed` (it already runs via the custom-gcl plugin). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe PR removes a redundant lint step, makes ChangesLint pipeline updates
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant lint_changed as lint changed
participant run_custom_golangci_lint as run-custom-golangci-lint.sh
participant filesystem as worktree filesystem
lint_changed->>run_custom_golangci_lint: invoke lint
run_custom_golangci_lint->>run_custom_golangci_lint: check ATMOS_LINT_SHARED_CACHE
run_custom_golangci_lint->>filesystem: set GOLANGCI_LINT_CACHE to .golangci-cache
run_custom_golangci_lint->>filesystem: set TMPDIR to .golangci-tmp
run_custom_golangci_lint->>filesystem: create .golangci-tmp directory
run_custom_golangci_lint->>lint_changed: run golangci-lint with isolated cache and lock paths
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2701 +/- ##
=======================================
Coverage 81.18% 81.18%
=======================================
Files 1630 1630
Lines 154206 154206
=======================================
+ Hits 125186 125193 +7
+ Misses 22101 22093 -8
- Partials 6919 6920 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
💥 This pull request now has conflicts. Could you fix it Erik Osterman (Cloud Posse) (@osterman)? 🙏 |
…tom-gcl-caching # Conflicts: # scripts/run-custom-golangci-lint.sh
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
|
These changes were released in v1.223.0-rc.7. |
…#2988) * perf(lint): move golangci-lint cache/tmp out of worktrees to user cache dir In-worktree .golangci-cache/.golangci-tmp (156MB / ~37k files churning per lint run, from cloudposse#2701) sat under filesystem watchers (git fsmonitor, Conductor's watchexec), saturating macOS FSEvents at multi-worktree scale and stalling every index-refreshing git command for seconds to minutes. Relocate the default cache/tmp to <user-cache>/atmos-lint/<worktree-hash>/, preserving cloudposse#2701's per-worktree lock isolation. ATMOS_LINT_SHARED_CACHE=1 and explicit GOLANGCI_LINT_CACHE overrides are unchanged. See docs/fixes/2026-08-24-fsmonitor-worktree-saturation.md for the full measured diagnosis. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs(fixes): add PR reference and end-to-end timing to fsmonitor fix record Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
what
TMPDIRandGOLANGCI_LINT_CACHEat repo-local dirs inscripts/run-custom-golangci-lint.shso each worktree gets its own golangci-lint lock and cache (GOCACHEstays shared for warm typecheck data); opt out withATMOS_LINT_SHARED_CACHE=1.custom-gclbinary inatmos lint custom-gclwhen it is already up to date (staleness guard mirroringlint lintroller/lint gomodcheck).lint lintrollerpass fromatmos lint changed(it already runs as a plugin insidecustom-gcl).why
os.TempDir()/golangci-lint.lock), not insideGOLANGCI_LINT_CACHE, so parallel worktree lints (e.g. rebase storms after a merge) serialized on one lock and a run orphaned by a tool timeout froze every other worktree; relocating the lock via a per-worktreeTMPDIRlets them run in parallel and contains an orphan to its own worktree.custom-gcl(clone + compile) on everylint changedwas the single biggest per-run cost during a rebase storm when the binary is identical across worktrees.TMPDIRlint ran at ~94% CPU in parallel with another holding the global lock, with its lock file under.golangci-tmp/.references
no-release.