[Bug 16229] New: Koha::Cache should be on the safer side
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 Bug ID: 16229 Summary: Koha::Cache should be on the safer side Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: major Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org Depends on: 16044 Blocks: 16221 Theoretically our Koha::Cache is not as safe as possible, the set_in_cache and get_from_cache subroutines should always clone the structure to avoid uncontrollable behaviors. There are, at least, 2 issues to cover: - get_from_cache does not deep copy on first call - set_in_cache does not deep copy Note that bug 16221 plans to replace Clone::clone with Storable::dclone, it should be built on top of this patch. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16044 [Bug 16044] Define a L1 cache for all objects set in cache https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16221 [Bug 16221] Use Storable::dclone() instead of Clone::clone() for L1 cache deep-copying mode -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 50072 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50072&action=edit Bug 16229: Deep copy on first L2 fetch When a value exists in L2 cache but not in L1 cache, it should be deep copied if needed (i.e. not a scalar). Otherwise the calling code is able to modify the value in cache. Note that is theoretical, it's possible that no code does that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 50073 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50073&action=edit Bug 16229: Deep copy on setting in cache Koha::Cache->set_in_cache should deep copy (if needed) to avoid the value which has been set in cache to be unintentionally modified later. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 50074 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50074&action=edit Bug 16229: Add the unsafe flag to set_in_cache Could be useful later. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #50074|0 |1 is obsolete| | --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 50076 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50076&action=edit Bug 16229: Add the unsafe flag to set_in_cache Could be useful later. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Koha::Cache should be on |Koha::Cache should be on |the safer side |the safe side -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |abl@biblos.pk.edu.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=16166 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 Jacek Ablewicz <ablewicz@gmail.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=16229 Jacek Ablewicz <ablewicz@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #50072|0 |1 is obsolete| | --- Comment #5 from Jacek Ablewicz <ablewicz@gmail.com> --- Created attachment 50199 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50199&action=edit Bug 16229: Deep copy on first L2 fetch When a value exists in L2 cache but not in L1 cache, it should be deep copied if needed (i.e. not a scalar). Otherwise the calling code is able to modify the value in cache. Note that is theoretical, it's possible that no code does that. Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 Jacek Ablewicz <ablewicz@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #50073|0 |1 is obsolete| | --- Comment #6 from Jacek Ablewicz <ablewicz@gmail.com> --- Created attachment 50200 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50200&action=edit Bug 16229: Deep copy on setting in cache Koha::Cache->set_in_cache should deep copy (if needed) to avoid the value which has been set in cache to be unintentionally modified later. Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 Jacek Ablewicz <ablewicz@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #50076|0 |1 is obsolete| | --- Comment #7 from Jacek Ablewicz <ablewicz@gmail.com> --- Created attachment 50201 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50201&action=edit Bug 16229: Add the unsafe flag to set_in_cache Could be useful later. Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #50199|0 |1 is obsolete| | --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 50235 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50235&action=edit Bug 16229: Deep copy on first L2 fetch When a value exists in L2 cache but not in L1 cache, it should be deep copied if needed (i.e. not a scalar). Otherwise the calling code is able to modify the value in cache. Note that is theoretical, it's possible that no code does that. Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #50200|0 |1 is obsolete| | --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 50236 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50236&action=edit Bug 16229: Deep copy on setting in cache Koha::Cache->set_in_cache should deep copy (if needed) to avoid the value which has been set in cache to be unintentionally modified later. Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #50201|0 |1 is obsolete| | --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 50237 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50237&action=edit Bug 16229: Add the unsafe flag to set_in_cache Could be useful later. Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 50238 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50238&action=edit Bug 16229: (QA) POD fixes Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA 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=16229 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |brendan@bywatersolutions.co | |m --- Comment #12 from Brendan Gallagher <brendan@bywatersolutions.com> --- Pushed to Master - Should be in the May 2016 Release. Thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Master |RESOLVED CC| |julian.maurice@biblibre.com --- Comment #13 from Julian Maurice <julian.maurice@biblibre.com> --- Not needed in stable versions, status changed to RESOLVED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |16166 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16166 [Bug 16166] Improve L1 cache performance and safety -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16229 --- Comment #14 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Julian Maurice from comment #13)
Not needed in stable versions, status changed to RESOLVED
Finally needed, because bug 16044 was pushed into 3.22.x Patches pushed to 3.22.x, will be in 3.22.8 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org