]> git.koha-community.org Git - koha.git/commit
Bug 32481: Limit prefetch size for background jobs worker
authorDavid Cook <dcook@prosentient.com.au>
Thu, 22 Dec 2022 22:17:04 +0000 (22:17 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Tue, 24 Jan 2023 18:29:16 +0000 (18:29 +0000)
commit0b206ff70962b02748e1456b3eec694f35c14451
treeb55ade2213229a14eb79133c2a712a607bccf046
parentb7632281d1d0a8095a521de0054dd0f967e3efa5
Bug 32481: Limit prefetch size for background jobs worker

This patch adds a prefetch size of 1 to the background jobs worker,
so that it fetches 1 message at a time. Without this change,
the RabbitMQ connection timeout when too many messages for slow tasks
are fetched at the same time.

To test:
0. Apply patch
1. Run background worker
2. Rapidly enqueue multiple jobs that in total will take longer
than 30 minutes to process

Bug 32481: Use correct prefetch syntax for RabbitMQ

According to https://www.rabbitmq.com/stomp.html the header to
use for managing the prefetch is "prefetch-count".

You can verify the number of delivered and unacknowledged messages
on a channel on a connection by running "rabbitmqctl list_channels"
on the RabbitMQ host. This will tell you how many messages have been
delivered and are awaiting acknowledgement

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cd89c383219eb9355b225b51219007a08b5e339e)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 6238ce057e2b2784d6c4a178728cb92d515ac454)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
misc/background_jobs_worker.pl