fix(targethasher): make directory hashing cancellation-aware (audit #14.3) - #269
Merged
Merged
Conversation
|
|
5 tasks
sbalabanov
commented
Aug 3, 2026
| ) | ||
|
|
||
| // cancelCheckInterval is how often the directory walk checks for cancellation, | ||
| // measured in files hashed. Matches the convention used elsewhere in the |
Contributor
Author
There was a problem hiding this comment.
Do not use words "matches the convention", just describe what this setting is for.
Contributor
Author
There was a problem hiding this comment.
Updated the comment in 35d2ee5 to directly state that the setting controls how many files are hashed between cancellation checks during a directory walk.
[addressed by agent]
….3) Summary: Audit #14.3 extracts targethasher cancellation propagation from #262. Intent: - Stop directory hashing promptly when graph computation is canceled. - Preserve cancellation causes through both target graph implementations. Changes: - Thread context through SourceHasher and all callers. - Check cancellation before and periodically during directory traversal. - Cover public hasher cancellation and context propagation through both graph paths.
sbalabanov
marked this pull request as ready for review
August 3, 2026 23:57
sbalabanov
force-pushed
the
audit/fix-14-3-targethasher-cancellation
branch
from
August 3, 2026 23:57
77f0d98 to
35d2ee5
Compare
xytan0056
approved these changes
Aug 4, 2026
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
Audit #14.3. Propagate cancellation into source-directory hashing across both target graph implementations.
Intent
Stop expensive directory traversal when graph computation is canceled and preserve custom cancellation causes through the hashing boundary.
Changes
context.Contextto theSourceHashercontract and update all implementations, callers, fakes, and mocks.context.Causeand verify both graph paths pass the original context.Test Plan
go test ./core/targethasher ./core/itg/graph./tools/bazel test //core/targethasher:targethasher_test //core/itg/graph:graph_test --test_output=errorsmake gazelleaifx verifyRevert Plan
Revert this PR to restore the context-free source hashing interface and traversal behavior.
Jira Issues
None.