Rotate BReg authority work classes instead of returning after the first submission

Open
#1,237 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
postgresql, rust
Domain
backend, databases

Research direction

Start in crates/registry-breg/src/review_store.rs at ReviewWorker::run_one and trace the authority work-class loops and their fixed ordering. Add or update the Postgres test described in the issue, and consider the work done when continuously ready submissions no longer prevent a pending cancellation and due result poll from making progress.

Written by the indexing model from the issue text.

Description

An automated review of #1189 flagged a fairness gap in the BReg review worker's authority pass. In crates/registry-breg/src/review_store.rs, run_one walks its work classes in a fixed order and returns Ok(true) as soon as one unit of work succeeds: submissions first, then cancellations, then the result feed, then result polls.

Failure scenario: pending submissions stay continuously ready, so every pass ends in the submissions loop and the cancellation and result loops below never run. ReviewWorker already stops application jobs from starving authority work, but sustained submission traffic can still starve accepted or cancelling reviews until their recovery or result-retention windows expire.

Suggested fix:

  • Rotate the authority work classes across passes (round-robin or a per-class cursor) instead of always restarting at submissions.
  • Add a Postgres test with continuously ready submissions that asserts a pending cancellation and a due result poll still make progress.

Filed from the review of #1189; not merge-blocking.

Dominant language
Rust
Stars
2
Forks
0
Avg merge
3h 45m
Merged PRs (30d)
134

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from registrystack/registry-stack

All issues in registrystack/registry-stack

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.