Skip to content

fix(daemon): late retirement can remove a newer Hook V2 replay consumer #3982

Closed

Description

@ScriptedAlchemy

shutdown_hook_v2_replay_consumer(data_root) (crates/tracedecay/src/daemon/hook_v2_replay_consumer.rs:562) removes registered_replay_roots()[data_root], aborts its task and calls spool_watch::detach_consumer(data_root). It never checks that the registration belongs to the owner being shut down.

If a project's server retires while a newer owner for the same data root has already registered its consumer, the late shutdown removes and aborts the newer consumer and detaches its spool watch. That project then stops replaying Hook V2 work until something re-registers.

Observed once during the #3736 S5 work (PR #3981): daemon_suite twelve_project_journey_retires_idle_owners_without_empty_graphs failed with "must restore its Hook V2 replay consumer". It passed on 3 isolated reruns.

Done when shutdown removes only the registration it owns (an owner or generation token checked under the lock, with spool detach conditioned on the same check), and a test interleaves a late retirement with a newer registration for the same data root. That test must fail before the fix.

Activity

  1. added a commit that references this issue on Oct 15, 2026
    62e368e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions