[Bug 25109] New: Add execution locking to Koha::Script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 Bug ID: 25109 Summary: Add execution locking to Koha::Script Change sponsored?: --- Product: Koha Version: master 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 -- 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=25109 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | CC| |agustinmoyano@theke.io, | |jonathan.druart@bugs.koha-c | |ommunity.org, | |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com -- 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=25109 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102757 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102757&action=edit Bug 25109: Add lockdir configuration entry -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102758 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102758&action=edit Bug 25109: Add entry in about.pl about the configuration lockdir entry -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102759 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102759&action=edit Bug 25109: Add ->new and ->lock_exec to Koha::Script -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=25109 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102757|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=25109 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102758|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=25109 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102759|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=25109 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102760 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102760&action=edit Bug 25109: Add lockdir configuration entry -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102761 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102761&action=edit Bug 25109: Add entry in about.pl about the configuration lockdir entry -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102762 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102762&action=edit Bug 25109: Add ->new and ->lock_exec to Koha::Script -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |23571 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23571 [Bug 23571] Prevent concurrent execution of fines.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- 1. <zebra_lockdir>/var/lock/koha/__KOHASITE__</zebra_lockdir> + <lockdir>/var/lock/koha/__KOHASITE__</lockdir> So should we remove zebra_lockdir (and replace it with $lockdir/zebra)? 2. + "The 'script' parameter is mandatory. You should usually pass \$0" $0? Should be "script", right? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #7)
1. <zebra_lockdir>/var/lock/koha/__KOHASITE__</zebra_lockdir> + <lockdir>/var/lock/koha/__KOHASITE__</lockdir>
So should we remove zebra_lockdir (and replace it with $lockdir/zebra)?
Yes, but on a separate bug. If we agree on this, I can work on getting rid of zebra_lockdir of course.
2. + "The 'script' parameter is mandatory. You should usually pass \$0"
$0? Should be "script", right?
I tried to say that the 'script' parameter should generally be passed $0. This comes from my try to write the tests for this, in which Script.t was always picked if I used $0. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Taking care of some QA concerns. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102760|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=25109 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102761|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=25109 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102762|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=25109 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102814 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102814&action=edit Bug 25109: Add lockdir configuration entry -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102815 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102815&action=edit Bug 25109: Add entry in about.pl about the configuration lockdir entry -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102816 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102816&action=edit Bug 25109: Add ->new and ->lock_exec to Koha::Script -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102817 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102817&action=edit Bug 25109: Add 'wait' tests This simple patch introduces a test for the lock waiting scenario. It replicates the previous tests, but calls a script that passes the wait => 1 parameter to ->lock_exec. 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=25109 --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Thanks for the feedback, Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 Kyle M Hall <kyle@bywatersolutions.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=25109 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102814|0 |1 is obsolete| | Attachment #102815|0 |1 is obsolete| | Attachment #102816|0 |1 is obsolete| | Attachment #102817|0 |1 is obsolete| | --- Comment #15 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 102840 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102840&action=edit Bug 25109: Add lockdir configuration entry 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=25109 --- Comment #16 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 102841 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102841&action=edit Bug 25109: Add entry in about.pl about the configuration lockdir entry 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=25109 --- Comment #17 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 102842 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102842&action=edit Bug 25109: Add ->new and ->lock_exec to Koha::Script 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=25109 --- Comment #18 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 102843 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102843&action=edit Bug 25109: Add 'wait' tests This simple patch introduces a test for the lock waiting scenario. It replicates the previous tests, but calls a script that passes the wait => 1 parameter to ->lock_exec. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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=25109 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #19 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- lockdir vs lock_dir, please fix. Once fixed, I guess we will have a problem if the dir is not writable, but we need a -w test for the about warning? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #20 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #19)
lockdir vs lock_dir, please fix.
Once fixed, I guess we will have a problem if the dir is not writable, but we need a -w test for the about warning?
Oops. If it is not writeable it will raise a relevant exception and report back. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #21 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102856 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102856&action=edit Bug 25109: (QA follow-up) Fix typo in configuration entry name This patch fixes an error in the configuration retrieving line. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #22 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102887 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102887&action=edit Bug 25109: (QA follow-up) Add a test for lockdir writable in about.pl 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=25109 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |jonathan.druart@bugs.koha-c |y.org |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #23 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Tomás Cohen Arazi from comment #8)
(In reply to Jonathan Druart from comment #7)
1. <zebra_lockdir>/var/lock/koha/__KOHASITE__</zebra_lockdir> + <lockdir>/var/lock/koha/__KOHASITE__</lockdir>
So should we remove zebra_lockdir (and replace it with $lockdir/zebra)?
Yes, but on a separate bug. If we agree on this, I can work on getting rid of zebra_lockdir of course.
I opened bug 25141. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=25109 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102840|0 |1 is obsolete| | Attachment #102841|0 |1 is obsolete| | Attachment #102842|0 |1 is obsolete| | Attachment #102843|0 |1 is obsolete| | Attachment #102856|0 |1 is obsolete| | Attachment #102887|0 |1 is obsolete| | --- Comment #24 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 102904 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102904&action=edit Bug 25109: Add lockdir configuration entry Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> 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=25109 --- Comment #25 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 102905 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102905&action=edit Bug 25109: Add entry in about.pl about the configuration lockdir entry Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> 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=25109 --- Comment #26 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 102906 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102906&action=edit Bug 25109: Add ->new and ->lock_exec to Koha::Script Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> 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=25109 --- Comment #27 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 102907 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102907&action=edit Bug 25109: Add 'wait' tests This simple patch introduces a test for the lock waiting scenario. It replicates the previous tests, but calls a script that passes the wait => 1 parameter to ->lock_exec. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> 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=25109 --- Comment #28 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 102908 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102908&action=edit Bug 25109: (QA follow-up) Fix typo in configuration entry name This patch fixes an error in the configuration retrieving line. 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=25109 --- Comment #29 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 102909 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102909&action=edit Bug 25109: (QA follow-up) Add a test for lockdir writable in about.pl Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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=25109 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #30 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com --- Comment #31 from Joy Nelson <joy@bywatersolutions.com> --- enhancement not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |26645 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26645 [Bug 26645] t/Koha/Script.t is failing randomly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |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=25109 --- Comment #32 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #23)
(In reply to Tomás Cohen Arazi from comment #8)
Yes, but on a separate bug. If we agree on this, I can work on getting rid of zebra_lockdir of course.
I opened bug 25141.
Still waiting for a patch there. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 --- Comment #33 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Once again we have the proof that using sleep in tests is VERY bad. + sleep 1; # Make sure we start after the fork Tests are failing randomly on Jenkins, quite often (at least twice a week). Example for Koha_Master_D10 (#467) 15:01:46 koha_1 | # Failed test 'Exception found' 15:01:46 koha_1 | # at t/Koha/Script.t line 69. 15:01:46 koha_1 | # '' 15:01:46 koha_1 | # doesn't match '(?^u:Unable to acquire the lock.*)' 15:01:46 koha_1 | # Looks like you failed 1 test of 3. 15:01:46 koha_1 | 15:01:46 koha_1 | # Failed test 'lock_exec() tests' 15:01:46 koha_1 | # at t/Koha/Script.t line 87. 15:01:46 koha_1 | # Looks like you failed 1 test of 4. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |28485 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28485 [Bug 28485] LOCK_DIR missing in koha-install-log -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25109 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.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org