Bugzilla – Attachment 171509 Details for
Bug 35655
Make it possible to switch off RabbitMQ without any warns in logs/about page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35655: Only use STOMP if JobsNotificationMethod set to do so
Bug-35655-Only-use-STOMP-if-JobsNotificationMethod.patch (text/plain), 2.15 KB, created by
Mark Hofstetter
on 2024-09-14 12:59:10 UTC
(
hide
)
Description:
Bug 35655: Only use STOMP if JobsNotificationMethod set to do so
Filename:
MIME Type:
Creator:
Mark Hofstetter
Created:
2024-09-14 12:59:10 UTC
Size:
2.15 KB
patch
obsolete
>From 0dfe6a48ff5969d2a97d48ecec5353b490994508 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 12 Sep 2024 11:14:22 -0300 >Subject: [PATCH] Bug 35655: Only use STOMP if JobsNotificationMethod set to do > so > >This patch makes the background jobs (jobs from now on) enqueue step not >try to connect to the STOMP broker, unless explicitly told to do so. > >This is achieved by using a newly introduced system preference >`JobsNotificationMethod` which falls back to STOMP if undefined. > >The goal for this patch is to stop flooding the logs on very busy sites >when Rabbit is not being used. This shouldn't predate any efforts on >making the STOMP based jobs brokering mechanism solid and usable. > >To test: >1. On clean `main`, run: > $ ktd --shell >2. Open the logs on a separate terminal: > $ ktd --shell > k$ tail -f /var/log/koha/kohadev/*.log >3. Stage some MARC for import >=> SUCCESS: No warnings about STOMP >4. Import the staged records >=> SUCCESS: No warnings about STOMP >5. Stop rabbitmq: > k$ sudo service rabbitmq-server stop >6. Repeat 2-4 >=> FAIL: The logs say it couldn't connect to STOMP >7. Apply this patches and run: > k$ restart_all >8. Repeat 2-4 >=> FAIL: You get the same errors, because it defaults to STOMP and it is >not available >9. Start rabbit: > k$ sudo service rabbitmq-server start > k$ restart_all >10. Repeat 2-4 >=> SUCCESS: No warnings about STOMP >11. Change the `JobsNotificationMethod` system preference to *polling* > and stop rabbit: > k$ sudo service rabbitmq-server stop > k$ restart_all >12. Repeat 2-4 >=> SUCCESS: No warnings about STOMP >13. Sign off :-D > >Dedicated to Liz > >Signed-off-by: Mark Hofstetter <mark@hofstetter.at> >--- > Koha/BackgroundJob.pm | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm >index 33a6872ec0..dfd3cd335c 100644 >--- a/Koha/BackgroundJob.pm >+++ b/Koha/BackgroundJob.pm >@@ -121,6 +121,11 @@ sub enqueue { > } > )->store; > >+ my $notification_method = C4::Context->preference('JobsNotificationMethod') // 'STOMP'; >+ >+ return $self->id >+ unless $notification_method eq 'STOMP'; >+ > $job_args->{job_id} = $self->id; > > my $conn; >-- >2.39.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 35655
:
171412
|
171413
|
171503
|
171504
|
171505
|
171506
|
171507
|
171509
|
171510
|
171511
|
171512
|
172027
|
172028
|
172029
|
172157
|
172158
|
172159
|
172232