Regression of bug 28413, bug 30410 added a "use Koha::Plugins" statement at the top of Koha::BackgroundJob, and so all Koha module are loaded by the worker on startup.
Created attachment 144973 [details] [review] Bug 32561: Prevent worker to run with unecessary modules in memory Regression of bug 28413, bug 30410 added a "use Koha::Plugins" statement at the top of Koha::BackgroundJob, and so all Koha module are loaded by the worker on startup. See bug 28413 for more info
Created attachment 144974 [details] [review] Bug 32561: Add test This test does not seem reliable enough, how could we improve it? I guess it will fail randomly, especially if ran in parallel with other processes/tests.
Created attachment 144975 [details] [review] Bug 32561: Add test This test does not seem reliable enough, how could we improve it? I guess it will fail randomly, especially if ran in parallel with other processes/tests.
Created attachment 144984 [details] [review] Bug 32561: Prevent worker to run with unecessary modules in memory Regression of bug 28413, bug 30410 added a "use Koha::Plugins" statement at the top of Koha::BackgroundJob, and so all Koha module are loaded by the worker on startup. See bug 28413 for more info Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 144985 [details] [review] Bug 32561: Add test This test does not seem reliable enough, how could we improve it? I guess it will fail randomly, especially if ran in parallel with other processes/tests. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 144986 [details] [review] Bug 32561: Test loaded modules for background_jobs_worker.pl Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
xt/memory_check.t bash: xt/memory_check.t: Permission denied root@master:/usr/share/koha# chmod 755 xt/memory_check.t Argument "/usr/share/koha/misc/background_jobs_worker.pl" isn't numeric in numeric gt (>) at xt/memory_check.t line 31. ok 1 - background_jobs_worker.pl is consuming /usr/share/koha/misc/background_jobs_worker.pl in memory Warning needs a fix? The test description of A consumes A is weird. I would personally only go for pushing the first patch. The two others seem not really needed. But thats just my first impression..
(In reply to Marcel de Rooy from comment #7) > I would personally only go for pushing the first patch. The two others seem > not really needed. But thats just my first impression.. Yes, same feeling for me. But this problem will come up again if there is no test :-/
(In reply to Jonathan Druart from comment #8) > (In reply to Marcel de Rooy from comment #7) > > I would personally only go for pushing the first patch. The two others seem > > not really needed. But thats just my first impression.. > > Yes, same feeling for me. But this problem will come up again if there is no > test :-/ That's possible although I think plugin support was one of the last pieces we needed to add? Perhaps it would be an idea to add some text to the "use <module>" area like "DO NOT ADD KOHA MODULES HERE OR YOU WILL FACE JONATHAN'S WRATH! See BZ 32561!"
Like I asked in https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30410#c18, do we have any example plugins that we can use to verify this change? I don't see any obvious ones listed at https://wiki.koha-community.org/wiki/Koha_plugins
(In reply to Marcel de Rooy from comment #7) > xt/memory_check.t > bash: xt/memory_check.t: Permission denied > root@master:/usr/share/koha# chmod 755 xt/memory_check.t Please fix > Argument "/usr/share/koha/misc/background_jobs_worker.pl" isn't numeric in > numeric gt (>) at xt/memory_check.t line 31. Please check. > ok 1 - background_jobs_worker.pl is consuming > /usr/share/koha/misc/background_jobs_worker.pl in memory > Warning needs a fix? The test description of A consumes A is weird. Please adjust.
(In reply to Marcel de Rooy from comment #11) > (In reply to Marcel de Rooy from comment #7) > > xt/memory_check.t > > bash: xt/memory_check.t: Permission denied > > root@master:/usr/share/koha# chmod 755 xt/memory_check.t > > Please fix > > > Argument "/usr/share/koha/misc/background_jobs_worker.pl" isn't numeric in > > numeric gt (>) at xt/memory_check.t line 31. > > Please check. > > > ok 1 - background_jobs_worker.pl is consuming > > /usr/share/koha/misc/background_jobs_worker.pl in memory > > Warning needs a fix? The test description of A consumes A is weird. > > Please adjust. We removed the tests here.
Created attachment 145617 [details] [review] Bug 32561: Prevent worker to run with unecessary modules in memory Regression of bug 28413, bug 30410 added a "use Koha::Plugins" statement at the top of Koha::BackgroundJob, and so all Koha module are loaded by the worker on startup. See bug 28413 for more info Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(In reply to Jonathan Druart from comment #12) > We removed the tests here. Good for me.
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to stable for 22.11.x