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: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected]

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.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to