Bugzilla – Attachment 161071 Details for
Bug 35819
"No job found" error for BatchUpdateBiblioHoldsQueue (race condition)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[ALTERNATE] Bug 35819: Notify NACK when Job ID not found
Bug-35819-Notify-NACK-when-Job-ID-not-found.patch (text/plain), 1.87 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-01-16 17:51:20 UTC
(
hide
)
Description:
[ALTERNATE] Bug 35819: Notify NACK when Job ID not found
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-01-16 17:51:20 UTC
Size:
1.87 KB
patch
obsolete
>From f28dfb24909222f89346b7438ec774e6cec96185 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 16 Jan 2024 14:46:20 -0300 >Subject: [PATCH] Bug 35819: Notify NACK when Job ID not found > >--- > misc/workers/background_jobs_worker.pl | 23 +++++++++++++---------- > 1 file changed, 13 insertions(+), 10 deletions(-) > >diff --git a/misc/workers/background_jobs_worker.pl b/misc/workers/background_jobs_worker.pl >index fde3432143a..d7015d646f2 100755 >--- a/misc/workers/background_jobs_worker.pl >+++ b/misc/workers/background_jobs_worker.pl >@@ -121,19 +121,22 @@ while (1) { > } catch { > Koha::Logger->get({ interface => 'worker' })->warn(sprintf "Frame not processed - %s", $_); > return; >- } finally { >- $conn->ack( { frame => $frame } ); > }; > >- next unless $args; >- >- # 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->search( { id => $args->{job_id}, status => 'new' } )->next; >+ my $job; > >- unless( $job ) { >- Koha::Logger->get( { interface => 'worker' } ) >- ->warn( sprintf "Job %s not found, or has wrong status", $args->{job_id} ); >+ if ( $args ) { >+ $job = Koha::BackgroundJobs->search( { id => $args->{job_id}, status => 'new' } )->next; >+ unless( $job ) { >+ Koha::Logger->get( { interface => 'worker' } ) >+ ->warn( sprintf "Job %s not found, or has wrong status", $args->{job_id} ); >+ # nack to force requeue >+ $conn->nack( { frame => $frame } ); >+ next; >+ } >+ $conn->ack( { frame => $frame } ); >+ } >+ else { > next; > } > >-- >2.43.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 35819
:
161067
|
161071
|
161139
|
161172
|
161173
|
161267
|
161527
|
161624
|
161682
|
161683
|
161684
|
161685
|
161686
|
161752
|
161753
|
161754
|
161755
|
161756
|
161757