-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Rewatch can index a retired project root #1116
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingpriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.stability/performanceServer crashes, OOM, hangs, high CPU/memoryServer crashes, OOM, hangs, high CPU/memoryux/behaviorDisplay bugs, docs, adoption UXDisplay bugs, docs, adoption UX
Milestone
Description
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.stability/performanceServer crashes, OOM, hangs, high CPU/memoryServer crashes, OOM, hangs, high CPU/memoryux/behaviorDisplay bugs, docs, adoption UXDisplay bugs, docs, adoption UX
Problem
cbm_watcher_poll_once()snapshots project-state pointers and polls without the table lock. Replacing a watch removes the old table entry but defers its free, so the old snapshot can still invoke the index callback for the retired root. If replacement overlaps that callback, a clean replacement registration may baseline without repairing the graph the old callback overwrote.The deferred-free change avoids use-after-free but does not provide registration-generation safety.
Suggested fix
Mark removed states retired, skip retired snapshots before callbacks, and force a different-root replacement to synchronize when replacement overlaps an active callback. Add deterministic rewatch/unwatch concurrency tests.