Bugzilla – Attachment 144809 Details for
Bug 32481
Rabbit times out when too many jobs are queued and the response takes too long
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32481: Limit prefetch size for background jobs worker
Bug-32481-Limit-prefetch-size-for-background-jobs-.patch (text/plain), 1.37 KB, created by
David Cook
on 2022-12-22 22:20:11 UTC
(
hide
)
Description:
Bug 32481: Limit prefetch size for background jobs worker
Filename:
MIME Type:
Creator:
David Cook
Created:
2022-12-22 22:20:11 UTC
Size:
1.37 KB
patch
obsolete
>From ed20ff6b58f1bd5d6c953c03944330e002c685fc Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Thu, 22 Dec 2022 22:17:04 +0000 >Subject: [PATCH] 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 >--- > misc/background_jobs_worker.pl | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/misc/background_jobs_worker.pl b/misc/background_jobs_worker.pl >index eb36f34f96..2a1baee151 100755 >--- a/misc/background_jobs_worker.pl >+++ b/misc/background_jobs_worker.pl >@@ -78,7 +78,11 @@ if ( $conn ) { > # FIXME cf note in Koha::BackgroundJob about $namespace > my $namespace = C4::Context->config('memcached_namespace'); > for my $queue (@queues) { >- $conn->subscribe({ destination => sprintf("/queue/%s-%s", $namespace, $queue), ack => 'client' }); >+ $conn->subscribe({ >+ destination => sprintf("/queue/%s-%s", $namespace, $queue), >+ ack => 'client', >+ 'activemq.prefetchSize' => 1, >+ }); > } > } > while (1) { >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32481
:
144809
|
145082
|
145134
|
145173
|
145208