Add new parameter to QueueworkerInterface, Follow up to #3517969

Created on 20 May 2025, 3 months ago

Problem/Motivation

This can only be done when development of 12.x is open

follow-up to ✨ Track the number of times a queue item is claimed and pass as an optional param to queue workers Active

Add the new parameter to the QueueWorkerInterface

Original description:

When using e.g. the DelayedRequeue exception or when a queue item fails and is claimed again later because its lease expires we have no way of checking in the queue worker itself whether there is some recurring failure that might necessitate discarding the queue item or e.g. moving it to a dead letter queue.

This is not exactly the cron or batch systems, but related. Not seeing a component for queue system

Steps to reproduce

Proposed resolution

Update the queue schema to support a column for the number of times an item has been claimed. Increment that number. Add an extension of the QueueWorkerInterface with a version of the processItem() methods that receives all the fields from the queue table except the data.

The proposed change should also resolve the 2 linked issues:
✨ Cron queue workers should receive queued item creation data Active
πŸ“Œ BatchQueue::claimItem() can get stuck with huge data in batch queue Needs review

We could consider adding support in queue processing for something like an InvalidQueueItem exception that would log a message and remove the item from the queue, but the queue worker itself could log a message and return to just allow the item to be deleted.

For now, implement without adding support for a new exception type.

Remaining tasks

Review and validate changes

User interface changes

n/a

Introduced terminology

API changes

Possible new interface subclass

Data model changes

Add a column to the queue table

Release notes snippet

todo

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component

cron system

Created by

πŸ‡ΊπŸ‡ΈUnited States pwolanin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024