[Koha-bugs] [Bug 35995] New: Real time holds queue jobs for the same record should run in serial, never parallel

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Feb 5 16:49:12 CET 2024


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

            Bug ID: 35995
           Summary: Real time holds queue jobs for the same record should
                    run in serial, never parallel
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Hold requests
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: kyle at bywatersolutions.com
        QA Contact: testopia at bugs.koha-community.org
                CC: gmcharlt at gmail.com

As described in bug 34596 there are times when multiple jobs to rebuild the
holds queue for a single job will run where the first job as the last to
execute ( or at least the last to finish ).

We need to force these jobs to run in serial, and only the newest job for a
given record *needs* to run, older jobs can exit early.

To this end, I propose a "holds queue job lock" table. The table will have rows
for the record id, and the timestamp of job initiation.

When a job begins processing, it will attempt to insert a row into this table.
If that insert succeeds, the job will process then remove the lock from the
table.

If the insert fails, it means another job has already written a lock. 
The blocked job can then read the row in the table.
If the queued time for the job that got the lock is newer than the time queued
for the blocked job that is checking it, that job can exit as it is obsolete.
If the queue time for the job that got the lock is older than the time queue
for the blocked job, that job needs to reinsert itself into the job queue
before exiting so it may try again in the future.

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


More information about the Koha-bugs mailing list