Skip already-applied review clock steps before testing queue service

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

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
postgresql, rust
Domain
backend, databases

Research direction

Start in crates/registry-casework/src/review.rs and inspect the due-step loop, especially the destination service check and casework_review_clock_effects handling. Add a Postgres test covering an applied step whose destination later becomes unserved, followed by a due step to a served queue. Done means the already-applied step is skipped and the later step runs.

Written by the indexing model from the issue text.

Description

An automated review of #1189 flagged an ordering problem in the review clock worker. In crates/registry-casework/src/review.rs, the due-step loop tests casework_queue_service for the step's destination queue before the casework_review_clock_effects conflict check that would reveal the step was already applied. An unserved destination defers the whole occurrence by 30 seconds.

Failure scenario: a reassignment step is applied while its destination queue is served, and the queue later loses its service row. On the next pass the worker re-examines that already-applied step, finds the destination unserved, and defers the occurrence. It never reaches a later due step that would move the task to a currently served queue, so the occurrence stalls indefinitely.

Suggested fix:

  • Load or check the applied effects before testing the destination's service coverage, and skip steps already recorded in casework_review_clock_effects.
  • Add a Postgres test where a step is applied, its destination is unserved afterwards, and a later due step must still run.

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.