limits_concurrency on_conflict: :discard looking only into running jobs and not blocked jobs

Aperta
#804 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
ruby
Ambito
backend

Direzione di ricerca

Start at the concurrency handling for limits_concurrency with on_conflict: :discard, and trace how jobs in Running, Ready, and Blocked are considered while a semaphore remains active. Reproduce the ProcessPrunedError-style state with frequent scheduling; done means conflicting jobs are discarded rather than accumulating in Blocked until the semaphore expires.

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

Descrizione

In the uncommon case that (because of whatever error, possibly ProcessPrunedError), a job is not running anymore but the Semaphore hasn't expired yet, SolidQueue is piling up new jobs in "Blocked", thus not fulfilling the on_conflict: discard promise.

I see two possible solutions:

  1. Consider checking if a semaphore is blocking for the key
  2. Check if a job is "running" not only by looking if there is a job in running or ready but also possibly in blocked

It's slightly an edge case, but if the cron is set up to a quite high frequency, it can pile up quite a bit in the few hours the semaphore hasn't expired.

NB: this happened on SolidQueue 1.3.1. We want to update soon and I have not seen in the changelog what could have fixed it "en passant"

Lingua principale
Ruby
Stelle
2.5k
Fork
250
Merge medio
8h 31m
PR unite (30g)
5

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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 rails/solid_queue

Tutte le issue di rails/solid_queue

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.