[Bug 30350] New: Do not hardcode job types
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 Bug ID: 30350 Summary: Do not hardcode job types Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Currently background_jobs_worker.pl has a hardcoded list. It should be using a method in Koha::BackgrounJob(s) instead, avoiding the need to maintain this list. Right now it could use Koha::BackgroundJob::type_to_class_mapping. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Status|NEW |Needs Signoff Depends on| |30172 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30172 [Bug 30172] Background jobs failing due to race condition -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 132246 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132246&action=edit Bug 30350: Avoid hardcoding job types in background_jobs_worker.pl Currently, background_jobs_worker.pl has a hardcoded list of jobs it can process. Koha::BackgroundJob already has a method that can be used to extract such list. Using it would avoid having to maintain two lists, and it would also make it easier to inject plugin tasks as well. To test: 1. Apply the patch 2. Restart the koha-worker 3. Run one of the batch operations that make use of the background jobs (I used batch item delete) => SUCCESS: Things work, no change 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- The point was to have different workers with different job types. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=27434 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #2)
The point was to have different workers with different job types.
Yeah, I get it, but it is not implemented yet, right? Let's talk about it on monday :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132246|0 |1 is obsolete| | --- Comment #4 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 132298 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132298&action=edit Bug 30350: Avoid hardcoding job types in background_jobs_worker.pl Currently, background_jobs_worker.pl has a hardcoded list of jobs it can process. Koha::BackgroundJob already has a method that can be used to extract such list. Using it would avoid having to maintain two lists, and it would also make it easier to inject plugin tasks as well. To test: 1. Apply the patch 2. Restart the koha-worker 3. Run one of the batch operations that make use of the background jobs (I used batch item delete) => SUCCESS: Things work, no change 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> JD amended patch -my @job_types = keys %{Koha::BackgroundJob::type_to_class_mapping}; +my @job_types = keys %{Koha::BackgroundJob::type_to_class_mapping()}; To remove the following error: Ambiguous use of %{Koha::BackgroundJob::type_to_class_mapping} resolved to %Koha::BackgroundJob::type_to_class_mapping Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132298|0 |1 is obsolete| | --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 132857 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132857&action=edit Bug 30350: Avoid hardcoding job types in background_jobs_worker.pl Currently, background_jobs_worker.pl has a hardcoded list of jobs it can process. Koha::BackgroundJob already has a method that can be used to extract such list. Using it would avoid having to maintain two lists, and it would also make it easier to inject plugin tasks as well. To test: 1. Apply the patch 2. Restart the koha-worker 3. Run one of the batch operations that make use of the background jobs (I used batch item delete) => SUCCESS: Things work, no change 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> JD amended patch -my @job_types = keys %{Koha::BackgroundJob::type_to_class_mapping}; +my @job_types = keys %{Koha::BackgroundJob::type_to_class_mapping()}; To remove the following error: Ambiguous use of %{Koha::BackgroundJob::type_to_class_mapping} resolved to %Koha::BackgroundJob::type_to_class_mapping Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |ASSIGNED --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I would like to take this out of the RM queue for now, as work on bug 27783 might make this require some changes. If someone (including me) finds this is still relevant, let's make it PQA again. Thanks Kyle! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 Bug 30350 depends on bug 30172, which changed state. Bug 30172 Summary: Background jobs failing due to race condition https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30172 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldoldstable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30350 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Resolution|--- |DUPLICATE Status|ASSIGNED |RESOLVED --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- We opted for Queues in bug 27783.. marking as Resolved Fixed *** This bug has been marked as a duplicate of bug 27783 *** -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org