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

  1. Make sure using database queue. Claim an item for one second with drush command. Example: drush eval '\Drupal::queue("sample_queue")->claimItem(1);'
  2. Go to queue manager form and apply batch process option to the queue.
  3. 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

Command icon 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

murat_kekic created an issue. See original summary.

murat_kekic’s picture

Status: Active » Needs review

voleger made their first commit to this issue’s fork.

  • voleger committed 53bc1fb8 on 3.2.x authored by murat_kekic
    Issue #3538611 by murat_kekic, voleger: Batch doesn't process items with...
voleger’s picture

Status: Needs review » Fixed

The change makes sense. Thanks for the fix.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.