Share the Find Work catalog refresh across application workers #453

Closed
opened 2026-08-10 04:29:03 +00:00 by timmy · 0 comments
Owner

Problem

The Find Work catalog uses process-local cache and single-flight state. In a multi-worker deployment, each worker can independently scan up to ten Gitea pages every 15 seconds, consuming the bounded upstream read pool and serving divergent claim state.

Vertical slice

Persist the available-issue snapshot, retry metadata, and an expiring refresh lease in shared SQLite state. One worker refreshes while peers immediately serve the retained snapshot with truthful stale/revalidating/failure metadata. Confirmed claims invalidate the shared catalog for every worker.

Acceptance tests

  • Two independent worker stores sharing one database allow exactly one expired-catalog refresh lease.
  • A peer serves retained results immediately while the owner refreshes.
  • Published results and confirmed-claim removals are visible across workers.
  • Refresh failure creates shared backoff, and an abandoned lease is recoverable after expiry.
  • SQLite work runs off the event loop and the full suite remains green.

Evidence

Current src/main.py keeps _available_issue_snapshot_* entirely in process memory, while gitea_proxy.available_issue_snapshot() can scan ten pages. Historical #213 covers same-process stale-while-revalidate and #433 covers shared live snapshots, not Find Work. No open or historical issue title or recent commit implements a worker-shared available-work catalog.

## Problem The Find Work catalog uses process-local cache and single-flight state. In a multi-worker deployment, each worker can independently scan up to ten Gitea pages every 15 seconds, consuming the bounded upstream read pool and serving divergent claim state. ## Vertical slice Persist the available-issue snapshot, retry metadata, and an expiring refresh lease in shared SQLite state. One worker refreshes while peers immediately serve the retained snapshot with truthful stale/revalidating/failure metadata. Confirmed claims invalidate the shared catalog for every worker. ## Acceptance tests - Two independent worker stores sharing one database allow exactly one expired-catalog refresh lease. - A peer serves retained results immediately while the owner refreshes. - Published results and confirmed-claim removals are visible across workers. - Refresh failure creates shared backoff, and an abandoned lease is recoverable after expiry. - SQLite work runs off the event loop and the full suite remains green. ## Evidence Current `src/main.py` keeps `_available_issue_snapshot_*` entirely in process memory, while `gitea_proxy.available_issue_snapshot()` can scan ten pages. Historical #213 covers same-process stale-while-revalidate and #433 covers shared live snapshots, not Find Work. No open or historical issue title or recent commit implements a worker-shared available-work catalog.
timmy self-assigned this 2026-08-10 04:29:03 +00:00
timmy closed this issue 2026-08-10 04:44:58 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stackchain/stackchain-dashboard#453
No description provided.