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:

  1. Resets processing outbox records that have exceeded STUCK_THRESHOLD (30 min) back to pending and clears started_at.
  2. Re-enqueues all pending records via Namespaces::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 in config/schedule.yml.
  • Adds a stuck_processing scope to Namespaces::StatePropagation.
  • idempotent!, data_consistency :sticky, urgency :low, with defer_on_database_health_signal.

Dependencies

⚠️ Depends on 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

Merge request reports

Loading