Skip to content

Hand the failed-job provider JSON on igbinary sites - #3

Merged
webpatser merged 2 commits into
mainfrom
fix/failer-json-payload
Aug 28, 2026
Merged

webpatser merged 2 commits into
mainfrom
fix/failer-json-payload

Conversation

@webpatser

Copy link
Copy Markdown
Owner

Why

scrpr.nl (igbinary serializer) logged [torque:worker] failed-jobs log threw: Trying to access array offset on null once per permanent failure (9,765 lines). The JobFailed listener handed the raw igbinary body to queue.failer, and database-uuids does json_decode($payload, true)['uuid']. Harmless for processing, but failed_jobs stayed empty so queue:failed / queue:retry did nothing on igbinary sites.

What

WorkerProcess::failerPayload() re-encodes an igbinary body as JSON and passes JSON through untouched. A retried job is transcoded back to igbinary on push by the existing transcodeIncomingPayload(), so the full round trip works.

Chosen over skipping the failer for non-JSON serializers, which would have silenced the line but kept failed_jobs empty.

Verified

  • Unit tests for the helper; feature test drives the real DatabaseUuidFailedJobProvider on in-memory sqlite with both bodies, including one that reproduces the exact production error with the raw body
  • Full suite: 495 passed, 0 failed
  • Verified on the host: php-resp3 0.1.4 is loaded there but not involved (zero wire/parse errors in the log; the error count equals the dead-letter count)

…irst stream's

Redis returns up to COUNT entries per stream for a multi-stream XREADGROUP.
The parser kept the first stream's entry and dropped the rest on the floor,
leaving them delivered-but-unprocessed in the consumer's PEL until
retry_after allowed a steal. Buffer the extra entries per worker and serve
them before the next read.
The JobFailed listener passed the raw igbinary body to queue.failer, and
database-uuids reads json_decode($payload, true)['uuid'], so every
permanent failure logged 'failed-jobs log threw: Trying to access array
offset on null' and failed_jobs stayed empty. WorkerProcess::failerPayload()
re-encodes igbinary bodies as JSON and passes JSON through untouched, so
queue:failed and queue:retry work with TORQUE_SERIALIZER=igbinary.
@webpatser
webpatser merged commit d01fa1f into main Aug 28, 2026
1 check passed
@webpatser
webpatser deleted the fix/failer-json-payload branch August 28, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant