Problem/Motivation

Getting error when trying to run any queue
An option named "items-limit" already exists.

Steps to reproduce

Install module, run queue list command to get list of queue, pick any queue and run with or without items-limit option.

drush queue:run media_entity_thumbnail --process-limit=2 --items-limit=5
drush queue:run media_entity_thumbnail --process-limit=2

Comments

Sharique created an issue. See original summary.

sharique’s picture

Issue summary: View changes
sharique’s picture

Issue summary: View changes
khiminrm’s picture

Received the same error with and without options.
Also sometimes received The "--process-limit" option does not exist.
Any solution?
Also I've question. It's not clear from the code of the command how each process received it's own set of the queue's items?
Couldn't fully test due errors.

khiminrm’s picture

Was able to fix the error by making options required:

    'items-limit' => self::REQ,
    'process-limit' => self::REQ,

Tested. And it looks there is another issue I've mentioned in previous comment - the same items are processed with different processes. When I used such options --items-limit=100 --process-limit=2, in most cases only 50 items where processed even if I received two messages in a console:

 [success] Processed 50 items from the my_test_queue queue in 0.13 sec.
 [success] Processed 50 items from the my_test_queue queue in 0.16 sec.

Also I've received another errors like:
PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /var/www/html/docroot/core/lib/Drupal/Core/Database/StatementWrapper.php:145