[Bug 30345] New: Koha::BackgroundJob->enqueue should set borrowernumber=undef if no userenv
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 Bug ID: 30345 Summary: Koha::BackgroundJob->enqueue should set borrowernumber=undef if no userenv Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal 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 It currently explodes. This is annoying in the tests. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Blocks| |29346 Status|NEW |Needs Signoff Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29346 [Bug 29346] Add real-time holds queue update option -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 132074 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132074&action=edit Bug 30345: Regression tests 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=30345 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 132075 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132075&action=edit Bug 30345: Make Koha::BackgroundJob->enqueue set borrowernumber=undef if no userenv This patch makes ->enqueue set undef if no userenv is provided. The CLI scripts will usually use Koha::Script and have this set to undef as well, but on the tests, there's usually no userenv set unless we need to test it. And as we are adding triggers everywhere, that will schedule background jobs, it means we would end up mocking userenv or the ->enqueue method everywhere and it will get messy. This patch just make it set undef. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/BackgroundJob.t => FAIL: Wow, it explodes badly. Same as any test that happens to trigger a background job enqueuing. 3. Apply this patch 4. Repeat 2 => SUCCESS: Great, tests pass! 5. 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=30345 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com, | |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132074|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132075|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 132243 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132243&action=edit Bug 30345: Regression tests 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=30345 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 132244 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132244&action=edit Bug 30345: Make Koha::BackgroundJob->enqueue set borrowernumber=undef if no userenv This patch makes ->enqueue set undef if no userenv is provided. The CLI scripts will usually use Koha::Script and have this set to undef as well, but on the tests, there's usually no userenv set unless we need to test it. And as we are adding triggers everywhere, that will schedule background jobs, it means we would end up mocking userenv or the ->enqueue method everywhere and it will get messy. This patch just make it set undef. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/BackgroundJob.t => FAIL: Wow, it explodes badly. Same as any test that happens to trigger a background job enqueuing. 3. Apply this patch 4. Repeat 2 => SUCCESS: Great, tests pass! 5. 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=30345 Arthur Suzuki <arthur.suzuki@biblibre.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=30345 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132243|0 |1 is obsolete| | Attachment #132244|0 |1 is obsolete| | --- Comment #5 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Created attachment 132824 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132824&action=edit Bug 30345: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |27344 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27344 [Bug 27344] Implement Elastic's update_index_background using Koha::BackgroundJob -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 --- Comment #6 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Created attachment 132825 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132825&action=edit Bug 30345: Make Koha::BackgroundJob->enqueue set borrowernumber=undef if no userenv This patch makes ->enqueue set undef if no userenv is provided. The CLI scripts will usually use Koha::Script and have this set to undef as well, but on the tests, there's usually no userenv set unless we need to test it. And as we are adding triggers everywhere, that will schedule background jobs, it means we would end up mocking userenv or the ->enqueue method everywhere and it will get messy. This patch just make it set undef. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/BackgroundJob.t => FAIL: Wow, it explodes badly. Same as any test that happens to trigger a background job enqueuing. 3. Apply this patch 4. Repeat 2 => SUCCESS: Great, tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |27783 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27783 [Bug 27783] Introduce background job queues -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|29346 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29346 [Bug 29346] Add real-time holds queue update option -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|27344 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27344 [Bug 27344] Implement Elastic's update_index_background using Koha::BackgroundJob -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 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=30345 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132824|0 |1 is obsolete| | Attachment #132825|0 |1 is obsolete| | --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 132851 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132851&action=edit Bug 30345: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> 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=30345 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132851|0 |1 is obsolete| | --- Comment #8 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 132852 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132852&action=edit Bug 30345: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> 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=30345 --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 132853 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132853&action=edit Bug 30345: Make Koha::BackgroundJob->enqueue set borrowernumber=undef if no userenv This patch makes ->enqueue set undef if no userenv is provided. The CLI scripts will usually use Koha::Script and have this set to undef as well, but on the tests, there's usually no userenv set unless we need to test it. And as we are adding triggers everywhere, that will schedule background jobs, it means we would end up mocking userenv or the ->enqueue method everywhere and it will get messy. This patch just make it set undef. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/BackgroundJob.t => FAIL: Wow, it explodes badly. Same as any test that happens to trigger a background job enqueuing. 3. Apply this patch 4. Repeat 2 => SUCCESS: Great, tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> 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=30345 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 Bug 30345 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=30345 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to master |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30345 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org