Draft: Add Namespaces::StatePropagationCronWorker
What does this MR do and why?
Adds Namespaces::StatePropagationCronWorker, the reconciliation worker for propagation-based state inheritance (ADR 003).
It catches lost or stalled propagation jobs:
- Resets
processingoutbox records that have exceededSTUCK_THRESHOLD(30 min) back topendingand clearsstarted_at. - Re-enqueues all
pendingrecords viaNamespaces::StatePropagationWorker.bulk_perform_async.
Deduplication on StatePropagationWorker (until_executed, including_scheduled: true) guarantees no duplicate job runs for the same arguments, so genuinely in-flight records are not double-processed. This is simpler and more robust than manually inspecting Sidekiq dedup locks.
Changes
- New cron worker, registered in
app/workers/all_queues.yml, scheduled every 5 minutes inconfig/schedule.yml. - Adds a
stuck_processingscope toNamespaces::StatePropagation. idempotent!,data_consistency :sticky,urgency :low, withdefer_on_database_health_signal.
Dependencies
Namespaces::StatePropagationWorker from !242220 (#599298). This MR should merge after !242220.
References
Closes #599300 Parent epic: &21922
How to set up and validate locally
bundle exec rspec spec/workers/namespaces/state_propagation_cron_worker_spec.rb