awa queue await-drain: block until in-flight work is zero (upgrade windows, deploys)
- Dominant language
- Rust
- Stars
- 32
- Forks
- 5
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 21
Description
The documented v042 upgrade procedure says 'stop or fully drain all workers' — but there is no single command to await drain. Operators must poll `queue stats` (which currently reads the slow compat view, see #422) and eyeball it.
Proposal: `awa queue await-drain [--queue Q] [--timeout T]` polling the discrete receipt/lease tables (canonical running shape from #410's open_receipt_running_claims_sql) + ready backlog, exiting 0 when in-flight=0 (optionally ready=0), non-zero on timeout. Pairs with the migrate pre-flight live-runtime check.
Effort: S-M. From the 2026-07-12 upgrade-rehearsal gap list.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the existing `awa queue stats` command and the `open_receipt_running_claims_sql` shape from #410; also inspect #422 because stats currently uses a slow compatibility view. Trace the migrate pre-flight live-runtime check, then verify that queue and timeout options work, success means the specified backlog is drained, and timeout returns non-zero.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, rust
- Domain
- backend, cli, databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100