Problem/Motivation
Batch processing either with ui or drush command doesn't process items with expired leases. This could happen because database queue depends on QueueGarbageCollectionInterface for releasing items. However garbage collection of queues done during the cron (by core cron hook). This creates a window where some items have expired leases making them unavailable for processing with this module.
While there is a "Remove leases" option in the Queue Manager form, it releases all items regardless of whether they are expired or not, so it might not be viable for some cases and adds manual overhead.
Steps to reproduce
- Make sure using database queue. Claim an item for one second with drush command. Example:
drush eval '\Drupal::queue("sample_queue")->claimItem(1);' - Go to queue manager form and apply batch process option to the queue.
- Observe that item with expired lease is not processed.
Proposed resolution
Run garbage collection before or during the batch process. For reference, the drush queue-run command (not to be confused with the drush command provided by this module) runs garbage collection before processing the items.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork queue_ui-3538611
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
murat_kekic commentedComment #6
volegerThe change makes sense. Thanks for the fix.