Bugzilla – Attachment 157496 Details for
Bug 32305
Background worker doesn't check job status when received from rabbitmq
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32305: Worker should ignore wrong status or queue in MQ mode
Bug-32305-Worker-should-ignore-wrong-status-or-que.patch (text/plain), 2.06 KB, created by
Martin Renvoize (ashimema)
on 2023-10-20 08:30:40 UTC
(
hide
)
Description:
Bug 32305: Worker should ignore wrong status or queue in MQ mode
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-10-20 08:30:40 UTC
Size:
2.06 KB
patch
obsolete
>From cae5cc289e20e0bfc1b4ade87c274dc95be8c38b Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 17 Oct 2023 14:43:32 +0000 >Subject: [PATCH] Bug 32305: Worker should ignore wrong status or queue in MQ > mode > >MQ mode: The worker has seen that MQ is running and consumes messages >instead of polling db only. > >Test plan: >Stop worker for long tasks. >Make sure that Rabbit MQ runs. >Stage a file. (This adds a long task.) >Goto staff view of jobs and cancel this job. >Check if job is still in MQ with rabbitmqctl list_queues. >Now start worker for long tasks. >Check if job is gone in MQ with rabbitmqctl list_queues. >And check logfile for the adjusted warning like: > [WARN] Job 5 not found, or has wrong status/queue main:: /usr/share/koha/misc/workers/background_jobs_worker.pl (134) > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > misc/workers/background_jobs_worker.pl | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/misc/workers/background_jobs_worker.pl b/misc/workers/background_jobs_worker.pl >index 7d2c4f38764..73353c00a11 100755 >--- a/misc/workers/background_jobs_worker.pl >+++ b/misc/workers/background_jobs_worker.pl >@@ -127,10 +127,11 @@ while (1) { > > # FIXME This means we need to have create the DB entry before > # It could work in a first step, but then we will want to handle job that will be created from the message received >- my $job = Koha::BackgroundJobs->find($args->{job_id}); >+ my $job = Koha::BackgroundJobs->search( { id => $args->{job_id}, status => 'new', queue => \@queues } )->next; > >- unless ( $job ) { >- Koha::Logger->get({ interface => 'worker' })->warn(sprintf "No job found for id=%s", $args->{job_id}); >+ unless( $job ) { >+ Koha::Logger->get( { interface => 'worker' } ) >+ ->warn( sprintf "Job %s not found, or has wrong status/queue", $args->{job_id} ); > next; > } > >-- >2.41.0
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 32305
:
144156
|
144278
|
144389
|
157256
|
157320
|
157321
|
157322
|
157496
|
157497
|
157500
|
157501