Bugzilla – Attachment 194561 Details for
Bug 41959
Holds queue builder doesn't always check all holds when using transport cost matrix
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41959: Handle edge case
Bug-41959-Handle-edge-case.patch (text/plain), 1.72 KB, created by
Nick Clemens (kidclamp)
on 2026-03-05 20:48:27 UTC
(
hide
)
Description:
Bug 41959: Handle edge case
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2026-03-05 20:48:27 UTC
Size:
1.72 KB
patch
obsolete
>From d41bbe5d2e42952142c2b78afd9eb64df8ff0799 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 5 Mar 2026 20:38:05 +0000 >Subject: [PATCH] Bug 41959: Handle edge case > >With a single hold at least the RETRY loop was never activated after an initial pass with 1 hold > >We try the hold - it cannot be filled - is removed from the requests array >The number of tasks is now 0, less than agents (1) and we don't enter remaining loop > >For this case we also need to always splice 1 from remaining, or it doesn't shrink >--- > C4/HoldsQueue.pm | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index c1d46954d1d..0e9e9b928d9 100644 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -486,12 +486,12 @@ RETRY: > while (1) { > return [] if $num_agents == 0 || $num_tasks == 0; > >- if ( $num_tasks < $num_agents && @remaining ) { >+ if ( $num_tasks <= $num_agents && @remaining ) { > > # On retry, move tasks from @remaining to @requests up to > # the number of agents. > my $nr = scalar(@remaining); >- my $na = $num_agents - $num_tasks; >+ my $na = $num_agents - $num_tasks || 1; > my $nm = $nr < $na ? $nr : $na; > push @requests, ( splice @remaining, 0, $nm ); > $num_tasks += $nm; >@@ -575,9 +575,9 @@ RETRY: > } > } > >- $num_tasks = scalar(@requests); >+ $num_tasks = scalar(@requests) + scalar(@remaining); > >- if ( $num_agents > $num_tasks && @remaining ) { >+ if ( $num_agents >= $num_tasks && @remaining ) { > > $r = $num_tasks; > @candidate_tasks = ( (1) x $num_tasks ); >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41959
:
194560
|
194561
|
194907