HDDS-15892. Massive local build time degradation when using agent worktrees#10791
Merged
Conversation
adoroszlai
approved these changes
Jul 17, 2026
Contributor
Author
|
Thanks @adoroszlai for the review! |
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.
What changes were proposed in this pull request?
Fix identified and implemented by Claude Code Opus 4.8
Issue
Agents like Claude and Cursor add worktrees to hidden directories within the repo by default, like
.claude/worktrees/. I have not been super proactive about cleaning worktrees when I'm done with them, and have accumulated ~20 so far.My local build command is:
This finishes in ~2 minutes in worktrees, but has crept up to 4+ minutes when run from the repo root. All the extra time seems to come from the distribution step.
From repo root:
From worktree:
Cause
The culprit looks to be the
findcommands in dist-layout-stitching which are traversing all subdirectories to find classpath and jar files, even hidden ones, which means they are incorrectly operating on every worktree's build results as well.Fix
The solution proposed here ignores all hidden directories that are immediate children of the repo root. This is a generic fix which will ignore directories like
.claudeand.cursor, and also save some time traversing other potentially large hidden directories.What is the link to the Apache JIRA
HDDS-15892
How was this patch tested?
Built locally from the master branch from repo root (not a worktree) with this patch applied: