Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Aberta
#343 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
47/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
php

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
PHP
Estrelas
61
Forks
31
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de yiisoft/queue

Todas as issues de yiisoft/queue

Issues semelhantes

Mais issues de PHP

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.