Skip to content

[core/itg/graph] Fix invalidation error not propagated#155

Open
sywhang wants to merge 4 commits into
mainfrom
fix/itg-invalidation-error
Open

[core/itg/graph] Fix invalidation error not propagated#155
sywhang wants to merge 4 commits into
mainfrom
fix/itg-invalidation-error

Conversation

@sywhang

@sywhang sywhang commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

In invalidateHashRecursively we never return an error even though the function signature supports returning an error and its callsites check for errors.

When the target is not found or if the target's hash is nil, it silently swallows and continues the loop. Skipping that causes us to actually skip all of its rdeps too.

This shouldn't be the case - we should return the error when it's not found at all. If the Hash is nil, then we check if it's already in our visited set (invalidated) instead of just silently skipping over it.

@sywhang sywhang requested review from a team as code owners July 7, 2026 22:08
target, ok := g.OptimizedTargets[targetID]
if !ok || target.Hash == nil {
if !ok {
return fmt.Errorf("target %d not found", targetID)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is intentional.
if the target doesn't exist (such as external rule targets naturally doesn't exits in OptimizedTargets). There's nothing to invalidate in ITG graph.

what's actually erroring out is removeTarget below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants