One slow handler stalls the outbox, and each delivery queries the default locale

Aperta
#3,303 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend

Direzione di ricerca

Start with src/FluentCMS.Core/Events/OutboxDrainer.cs and the worker registration in DependencyInjection/FluentCmsServiceCollectionExtensions.cs; the issue also names EventOperation.cs, JobExecutor.cs, OutboxKick.cs, and OutboxDrainJob.cs. Review the related job store behavior and coordinate with #3282, which changes the same drain. Done means meeting all five acceptance criteria and adding tests for each.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:events performance type:bug

Problem

  1. One slow handler stalls every handler. The outbox queue has one worker (DependencyInjection/FluentCmsServiceCollectionExtensions.cs:285) and a drain delivers rows one at a time (Events/OutboxDrainer.cs:59-71), so a handler that takes the 60 s DeliveryTimeout holds back all the others.
  2. Each delivery and each job run queries the default locale. Events/EventOperation.cs:19-22 and Jobs/JobExecutor.cs:248-251 read Site.DefaultLocale uncached.
  3. A failed drain suppresses kicks. Events/OutboxKick.cs:24 treats any pending drain job as already queued without looking at RunAt. After a failure the retry is pending in the future (Jobs/JobStore.cs:153-154), so delivery falls back to the every-minute drain for about 7 minutes.
  4. The idle recurring drain writes rows every minute. Events/OutboxDrainJob.cs:103 inserts a job and an attempt row per minute, kept 7 days: about 10,000 of each on an idle instance.

Paths are under src/FluentCMS.Core/.

Proposal

  • Deliver in parallel per handler name, keeping order within a handler.
  • Read the default locale through the site cache.
  • Count only a drain job that is due as already queued.
  • Skip the bookkeeping of the recurring drain when nothing is due, or shorten its retention.

Done together with #3282, which changes the same drain.

Acceptance

  • A handler that blocks does not delay deliveries to other handlers
  • Order within one handler is unchanged
  • Delivering a batch reads the default locale once per site
  • A kick after a failed drain is delivered without waiting for the recurring drain
  • An idle instance does not accumulate drain rows
  • Tests for each

Found in the code review of 17 Nov 2026.

Lingua principale
C#
Stelle
569
Fork
107
Merge medio
2h 49m
PR unite (30g)
397

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fluentcms/FluentCMS

Tutte le issue di fluentcms/FluentCMS

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.