[Koha-bugs] [Bug 30172] BackGround jobs failing due to race condition

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Feb 25 00:40:55 CET 2022


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

--- Comment #8 from David Cook <dcook at prosentient.com.au> ---
(In reply to Jonathan Druart from comment #6)
> Nick suggested me to set the status to "failed" in case the job was not
> enqueued.
> I am not sure it's the best we can do.
> 
> If a job is started but the connection failed, the exception will be thrown
> but the job will appear in the DB table. If the user already got the error
> on the UI I don't know if the job should be inserted.

You could test the MQ connection before inserting into the database. 

But if the MQ connection succeeds, you have to insert into the database before
sending the message to the MQ. Otherwise that race condition will persist.

If the "send_with_receipt" fails, then I think marking the job as "failed"
would be fair. (Alternatively, I suppose you could delete the job after warning
the user it failed.)

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


More information about the Koha-bugs mailing list