[Koha-bugs] [Bug 32573] background_jobs_worker.pl should ACK a message before it forks and runs the job

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Jan 9 23:42:24 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32573

--- Comment #9 from David Cook <dcook at prosentient.com.au> ---
(In reply to Nick Clemens from comment #7)
> I think for Koha we should ack as soon as we receive the job from RabbitMQ
> 
> We maintain our own DB table for background jobs, and this is our source of
> truth. We update this table with the results of a job, and use this table to
> determine status.

As you say, it's the "result store". As far as task queues go, they typically
have a database for a result store. That is separate from the messaging layer. 

> If we maintained Rabbit as the source of truth, we might want to keep jobs
> there until processed, but would then need to check Rabbit for the job
> statuses

RabbitMQ is the messaging layer. It's not a data layer. 

> Most of the jobs we are sending won't benefit from a retry if they fail - a
> bad record won't index no matter how many times we try. If we have jobs that
> are network based, and may fail because of connection issues, we should
> handle the re-queuing in the job itself - so ack the job - try it, if fail
> then queue it as new - then we can note the failure/requeue in Koha as well

If a bad record won't index, then you fail the job. That still has nothing to
do with the messaging layer. 

Once you fail the job and record that in the result store, you ack the message
to tell the messaging layer that you've handled that message. 

In terms of re-queuing, Koha doesn't really support that at the moment, since
there is no task scheduler. You can't re-queue for 5 minutes later to see if
the network has stabilized. That would be future functionality. 

> It looks like the Stomp protocol recommendations differ from the Net::Stomp
> and RabbitMQ docs, but I also don't see a negative side effect of ack before
> process

Can you refer to that recommendation specifically? I'm not sure what you mean.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list