Bug 23303 - When uninstalling a plugin we don't call any form of 'unload'
Summary: When uninstalling a plugin we don't call any form of 'unload'
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Plugin architecture (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-11 12:55 UTC by Martin Renvoize (ashimema)
Modified: 2023-12-14 23:24 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2019-07-11 12:55:39 UTC
We currently clean up the filesystem and run through the 'uninstall' method from the plugin in point during the uninstall process. We don't however, ever, unload the module code from memory and this may result in plack environments leaking memory.
Comment 1 David Cook 2023-12-14 23:24:00 UTC
(In reply to Martin Renvoize from comment #0)
> We currently clean up the filesystem and run through the 'uninstall' method
> from the plugin in point during the uninstall process. We don't however,
> ever, unload the module code from memory and this may result in plack
> environments leaking memory.

I don't think that this is possible in Perl though. 

In theory there's some things that can be down to unload the module (https://metacpan.org/pod/Class::Unload) but I don't know that it actually frees up any memory.

It would be interesting to do some experiments with it though...

Although it runs into the same problem as plugin upgrades. We'd need to signal it to all Starman workers.