Bug 30710

Summary: Background tasks can be called multiple times on batch item deletion
Product: Koha Reporter: Nick Clemens <nick>
Component: Hold requestsAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: normal    
Priority: P5 - low CC: david, gmcharlt, jonathan.druart, martin.renvoize, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00
Bug Depends on: 29346, 30467    
Bug Blocks: 30725, 30727, 30728    
Attachments: Bug 30710: Build holds queue once per biblio when batch deleting items
Bug 30710: Build holds queue once per biblio when batch deleting items
Bug 30710: Regression tests
Bug 30710: Build holds queue once per biblio when batch deleting items
Bug 30710: (QA follow-up) Add POD

Description Nick Clemens 2022-05-06 13:00:32 UTC
When batch deleting items and deleting biblios we can end up processing a single bib in the queue more than once, we should avoid this
Comment 1 Jonathan Druart 2022-05-06 13:18:58 UTC
This is a bug.
Comment 2 Nick Clemens 2022-05-06 13:22:30 UTC
This also impacts background ES indexing

To test:
1 - Find a record with multiple items
2 - On details page click 'delete items in a batch'
3 - Delete items
4 - Check background jobs list
5 - Note one reindex per item deleted, plus a non backgrounded deletion from index if record deleted
Comment 3 Jonathan Druart 2022-05-06 13:25:28 UTC
(In reply to Nick Clemens from comment #2)
> This also impacts background ES indexing

It's fixed on master (or patch is in PQA queue), search for "task does not deal with indexation correctly"
Comment 4 Nick Clemens 2022-05-06 14:45:42 UTC
Created attachment 134742 [details] [review]
Bug 30710: Build holds queue once per biblio when batch deleting items
Comment 5 Martin Renvoize 2022-05-06 15:06:05 UTC
Created attachment 134743 [details] [review]
Bug 30710: Build holds queue once per biblio when batch deleting items

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2022-05-06 15:06:30 UTC
Great work, clear fix.  Signing off
Comment 7 David Nind 2022-05-06 21:39:08 UTC
Changing status to signed off.
Comment 8 Tomás Cohen Arazi 2022-05-10 14:46:14 UTC
Created attachment 134817 [details] [review]
Bug 30710: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 9 Tomás Cohen Arazi 2022-05-10 14:46:19 UTC
Created attachment 134818 [details] [review]
Bug 30710: Build holds queue once per biblio when batch deleting items

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 10 Tomás Cohen Arazi 2022-05-10 14:46:25 UTC
Created attachment 134819 [details] [review]
Bug 30710: (QA follow-up) Add POD

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 11 Fridolin Somers 2022-05-11 08:49:15 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄