Skip to content

Add lease/timeout/reclaim to portfolio-queue's stuck items #4827

Description

@JSONbored

Problem: Portfolio-queue items are flipped to in_progress with no owner/heartbeat and no expiry sweep — unlike sibling stores in the same package (the claim-ledger and worktree-allocator both already solve this exact problem for their own tables). A crashed or killed process leaves an item stuck in_progress forever with no automated recovery.

Area: AMS / Miner

Proposal: Add a lease/heartbeat/expiry mechanism to portfolio-queue matching the pattern already used by the claim-ledger's expiry sweep and the worktree-allocator's orphan reclaim.

Deliverables:

  • A lease/heartbeat column and an expiry sweep for portfolio-queue, consistent with the two sibling stores that already have this.

Acceptance criteria:

  • A queue item from a killed process is automatically reclaimed after its lease expires.
  • A live, healthy process's lease renews and the item is never falsely reclaimed out from under it.

Resources:

  • The portfolio-queue module and its two sibling stores (claim-ledger expiry, worktree-allocator orphan reclaim) for the pattern to mirror.

Boundaries:

  • Match the existing sibling pattern rather than inventing a new mechanism.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    Status
    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions