[Koha-bugs] [Bug 28205] New: Less important hold trapped before or no hold trapped in some cases (race condition)
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Fri Apr 23 15:18:04 CEST 2021
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28205
Bug ID: 28205
Summary: Less important hold trapped before or no hold trapped
in some cases (race condition)
Change sponsored?: ---
Product: Koha
Version: master
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P5 - low
Component: Hold requests
Assignee: koha-bugs at lists.koha-community.org
Reporter: joonas.kylmala at helsinki.fi
QA Contact: testopia at bugs.koha-community.org
CC: gmcharlt at gmail.com
So our libraries ran into a strange hold problem which turned out to be a race
condition: if you change priority of holds and return an item and
build_holds_queue.pl cron is not yet run again the priority is not updated and
you fill hold with less importance! After build_holds_queue.pl the priorities
are OK because hold_fill_targets gets updated according to the right hold
priority. Similar race condition also happens when you have already some items
for the biblio in hold_fill_targets and add a new item to the biblio and try to
return it it doesn't attach to any waiting holds until the build_holds_queue.pl
is ran.
To better understand the issue I think it is easier to look the code in
C4::Reserves::_Findgroupreserve(). Explaining with words is bit difficult...
Basically in that function the SQL selects
> my $title_level_target_query = qq{
> my $query = qq{
should be UNION'ed to fix the case when adding new item which could potentially
fill the hold. This might cause unoptimal logistic route to be used but still
would follow the hold priority.
To fix the issue of changing hold priorities we need to update
hold_fill_targets table by calling C4::HoldsQueue::CreateQueue() every time
staff member updates hold priorities in a biblio.
But even with these improvements wouldn't this be buggy when deleting items
from the biblio record? Not sure how to solve that case.
Added major bug priority for this but if you feel like it doesn't deserve it
feel free to change to normal.
--
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