fix: global concurrency cap for hook-triggered indexers - #160
Open
rajkumarsakthivel wants to merge 4 commits into
Open
fix: global concurrency cap for hook-triggered indexers#160rajkumarsakthivel wants to merge 4 commits into
rajkumarsakthivel wants to merge 4 commits into
Conversation
Warm zinc-black palette, indigo accents, Inter+Outfit typography. Massive 94% number as hero focal point, trust-strip with editor logos, vertical numbered capabilities, horizontal benchmark stats, and comparison table with green "Best" pill.
Git hooks installed by CCE fire in all worktrees (shared .git/hooks/), and the old hook spawned unbounded background indexers. With N worktrees this produced N detached cce-index processes (observed: 36 at ~1.85GB each, ~66GB total on a 96GB machine). Three changes: - Global machine-wide lock via mkdir (POSIX portable, works on macOS without flock). At most one hook-triggered indexer runs at a time. - Skip ephemeral worktree paths (/tmp/*, .claude/worktrees/*) since those trees are deleted minutes later. - nice -n 10 so indexing never competes with foreground work. Also fixes: - install_hooks() now resolves through git common dir so hooks install correctly from inside a worktree. - cce init/upgrade replaces old hook blocks with the new guarded version instead of silently skipping when the marker is present. - Uninstall handles multi-line hook blocks (start/end markers).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #159. Git hooks fire in all worktrees (shared
.git/hooks/), and the old hook spawned unbounded background indexers. With N worktrees this produced N detachedcce indexprocesses.mkdir(POSIX portable, works on macOS withoutflock). At most one hook-triggered indexer runs at a time. Stale locks are reclaimed when the owner PID is dead./tmp/*,.claude/worktrees/*) since agent-created throwaway trees are deleted minutes later.nice -n 10so indexing never competes with foreground work.install_hooks()resolves throughgit rev-parse --git-common-dirso hooks install correctly from inside a worktree.cce initreplaces old single-line hook blocks with the new guarded version instead of silently skipping when the marker is present.