Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

A failing handler aborts the whole run and blocks everything behind it

Aperta
#343 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
47/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php

Direzione di ricerca

Read QueueConsumer::run(), QueueConsumer::handle(), and the failure path through Worker::process() and FailureFinalHandler; inspect stubs/InMemoryAdapter.php:53-56 for how failed messages remain queued. Decide how exhausted failures should affect the run, then check that later messages are handled and the failed message has the intended queue behavior.

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

Descrizione

One message whose handler throws ends QueueConsumer::run() for everything behind it, and the failing message stays in the queue, so the next run stops at the same place.

Three messages, the second one's handler throws:

run #1 THREW MessageFailureException: Processing of message without ID is stopped because of an exception: handler blew up.
handled so far: ["first"]
still queued:   ["poison:second","good:third"]

run #2 THREW MessageFailureException: ... (identical)
handled so far: ["first"]
still queued:   ["poison:second","good:third"]

third is never processed, and re-running does not help: queue:run exits at the same message every time.

Mechanically: Worker::process() rethrows as MessageFailureException once the failure pipeline is exhausted (FailureFinalHandler rethrows by design), the exception travels through QueueConsumer::handle() and out of InMemoryAdapter::runExisting(), which also skips the unset() for the current message (stubs/InMemoryAdapter.php:53-56).

A failure middleware that swallows or re-pushes avoids this, so there is a way out. But the default for a queue — stop at the first bad message, retry it forever, never reach the rest — seems worth a decision rather than a configuration note.

Per-message isolation in QueueConsumer::run(), where a message that exhausts its failure pipeline is logged and skipped rather than aborting the loop, would bound the damage to the message that caused it.

Lingua principale
PHP
Stelle
61
Fork
31
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 yiisoft/queue

Tutte le issue di yiisoft/queue

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.