[Bug 41919] New: Limit number of current reports a single user can run simultaneously
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41919 Bug ID: 41919 Summary: Limit number of current reports a single user can run simultaneously Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Reports Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: lisette@bywatersolutions.com Building on bug 41918, it would be good to limit the number of reports a given user can run at a time. This control should be conf file based as it is tied to the server resources provided by whoever administers the server. -- 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=41919 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |41918 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41918 [Bug 41918] Prevent users from running the same report multiple times concurrently -- 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=41919 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41920 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41920 [Bug 41920] Limit number of concurrent reports that can be run simultaneously for an instance of Koha -- 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=41919 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=41919 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=41919 --- Comment #1 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 193931 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193931&action=edit Bug 41919: Limit number of current reports a single user can run simultaneously Building on bug 41918, it would be good to limit the number of reports a given user can run at a time. This control should be conf file based as it is tied to the server resources provided by whoever administers the server. Test Plan: 1) Set total_running_reports_per_user_limit to 3 in your koha-conf.xml 2) Create 3 long running reports like: SELECT COUNT(*) FROM items i1 JOIN items i2 JOIN items i3 JOIN items i4 JOIN items i5 JOIN items i6 3) Run each report in turn by opening a new tab, browsing to the reports module, and choosing to run that report 5) Note the first two continue to run, but the last one gives an error that you have too many reports running simultaneously! -- 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=41919 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.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=41919 --- Comment #2 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 194041 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194041&action=edit Bug 41919: Limit number of concurrent reports that can be run simultaneously for an instance of Koha Building on bug 41918, it would be good to limit the number of reports a given user can run at a time. This control should be conf file based as it is tied to the server resources provided by whoever administers the server. Test Plan: 1) Set total_running_reports_per_user_limit to 3 in your koha-conf.xml 2) Create 3 long running reports like: SELECT COUNT(*) FROM items i1 JOIN items i2 JOIN items i3 JOIN items i4 JOIN items i5 JOIN items i6 3) Run each report in turn by opening a new tab, browsing to the reports module, and choosing to run that report 5) Note the first two continue to run, but the last one gives an error that you have too many reports running simultaneously! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41919 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194041|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=41919 --- Comment #3 from Lisette Scheer <lisette@bywatersolutions.com> --- Will this count stats wizard runs or only saved reports? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41919 Rebecca Coert <rcoert@arlingtonva.us> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rcoert@arlingtonva.us -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41919 Alex Carver [Acerock7] <alex@rcls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #4 from Alex Carver [Acerock7] <alex@rcls.org> --- Testing plan specifies setting new variable to 3 and then checking that the THIRD report triggers the message. However, the message does not appear until a 4th report is attempted. Confirmed with devs that this is intended behavior. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41919 Alex Carver [Acerock7] <alex@rcls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193931|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=41919 --- Comment #5 from Alex Carver [Acerock7] <alex@rcls.org> --- Created attachment 198034 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198034&action=edit Bug 41919: Limit number of current reports a single user can run simultaneously Building on bug 41918, it would be good to limit the number of reports a given user can run at a time. This control should be conf file based as it is tied to the server resources provided by whoever administers the server. Test Plan: 1) Set total_running_reports_per_user_limit to 3 in your koha-conf.xml 2) Create 3 long running reports like: SELECT COUNT(*) FROM items i1 JOIN items i2 JOIN items i3 JOIN items i4 JOIN items i5 JOIN items i6 3) Run each report in turn by opening a new tab, browsing to the reports module, and choosing to run that report 5) Note the first two continue to run, but the last one gives an error that you have too many reports running simultaneously! Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41919 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff Patch complexity|--- |Small patch QA Contact|testopia@bugs.koha-communit |martin.renvoize@openfifth.c |y.org |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41919 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198034|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=41919 --- Comment #6 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198270 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198270&action=edit Bug 41919: Limit number of current reports a single user can run simultaneously Building on bug 41918, it would be good to limit the number of reports a given user can run at a time. This control is config-file based as it is tied to the server resources provided by the administrator. Adds a new koha-conf.xml option total_running_reports_per_user_limit (0 = disabled). When the configured limit is reached, the user is told "You have too many reports running at the moment. Please wait for some of them to finish before running this report again." Note on implementation: the original patch on bz (attachment 198034) performed a second pre-flight Koha::Reports->running call in reports/guided_reports.pl. The bug 41918 QA follow-ups already pushed the duplicate-running guard into Koha::Report::prep_report so it would fire across the staff UI, svc/report and opac/svc/report. This patch extends that same model-layer architecture rather than reintroducing controller-layer enforcement: - New Koha::Exceptions::Report::TotalRunning subclass of Koha::Exceptions::Report. - prep_report now performs a second check after the duplicate one and throws TotalRunning when the user has total_running_reports_per_user_limit reports of any kind already in flight. - All three callers (guided_reports.pl, svc/report, opac/svc/report) catch the new exception alongside DuplicateRunning, mapping it to a new template error key total_running_reports_limit_exceeded for the staff UI and a JSON {error: total_running_reports_limit_exceeded} with HTTP 429 for the JSON endpoints. Test Plan: 1) Set total_running_reports_per_user_limit to 3 in your koha-conf.xml. 2) Create 3 long-running reports like: SELECT COUNT(*) FROM items i1 JOIN items i2 JOIN items i3 JOIN items i4 JOIN items i5 JOIN items i6 3) Run each report in turn by opening a new tab, browsing to the reports module, and choosing to run that report. 4) Note the first three continue to run, but a fourth attempt gives the new "too many reports running" alert in the staff UI. 5) Repeat against /cgi-bin/koha/svc/report?id=N and confirm an HTTP 429 response with JSON {error: total_running_reports_limit_exceeded}. 6) Set total_running_reports_per_user_limit back to 0 and confirm normal behaviour resumes. 7) prove t/db_dependent/Koha/Reports.t -> 13 tests pass, including a new subtest for TotalRunning. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41919 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> 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=41919 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198270|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=41919 --- Comment #7 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198271 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198271&action=edit Bug 41919: Limit number of current reports a single user can run simultaneously Building on bug 41918, it would be good to limit the number of reports a given user can run at a time. This control is config-file based as it is tied to the server resources provided by the administrator. Adds a new koha-conf.xml option total_running_reports_per_user_limit (0 = disabled). When the configured limit is reached, the user is told "You have too many reports running at the moment. Please wait for some of them to finish before running this report again." Note on implementation: the original patch on bz (attachment 198034) performed a second pre-flight Koha::Reports->running call in reports/guided_reports.pl. The bug 41918 QA follow-ups already pushed the duplicate-running guard into Koha::Report::prep_report so it would fire across the staff UI, svc/report and opac/svc/report. This patch extends that same model-layer architecture rather than reintroducing controller-layer enforcement: - New Koha::Exceptions::Report::TotalRunning subclass of Koha::Exceptions::Report. - prep_report now performs a second check after the duplicate one and throws TotalRunning when the user has total_running_reports_per_user_limit reports of any kind already in flight. - All three callers (guided_reports.pl, svc/report, opac/svc/report) catch the new exception alongside DuplicateRunning, mapping it to a new template error key total_running_reports_limit_exceeded for the staff UI and a JSON {error: total_running_reports_limit_exceeded} with HTTP 429 for the JSON endpoints. Test Plan: 1) Set total_running_reports_per_user_limit to 3 in your koha-conf.xml. 2) Create 3 long-running reports like: SELECT COUNT(*) FROM items i1 JOIN items i2 JOIN items i3 JOIN items i4 JOIN items i5 JOIN items i6 3) Run each report in turn by opening a new tab, browsing to the reports module, and choosing to run that report. 4) Note the first three continue to run, but a fourth attempt gives the new "too many reports running" alert in the staff UI. 5) Repeat against /cgi-bin/koha/svc/report?id=N and confirm an HTTP 429 response with JSON {error: total_running_reports_limit_exceeded}. 6) Set total_running_reports_per_user_limit back to 0 and confirm normal behaviour resumes. 7) prove t/db_dependent/Koha/Reports.t -> 13 tests pass, including a new subtest for TotalRunning. Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41919 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> 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=41919 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.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=41919 --- Comment #8 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41919 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emmi.takkinen@koha-suomi.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41919 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #9 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- This is causing the following Cypress test to fail: t/cypress/integration/Acquisitions/EdifactModal_spec.ts Please have a look. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41919 --- Comment #10 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- (In reply to Lucas Gass (lukeg) from comment #9)
This is causing the following Cypress test to fail:
t/cypress/integration/Acquisitions/EdifactModal_spec.ts
Please have a look.
Oh my, wrong bug report! Sorry -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41919 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting --- Comment #11 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- This will not be backported to 25.11.x due to it being deemed an enhancement or a dependancy not being met -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41919 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43016 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43016 [Bug 43016] [OMNIBUS] Server resource protection -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org