Bugzilla – Attachment 113990 Details for
Bug 16067
Koha::Cache, fastmmap caching system is broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16067: Remove FastMmap
Bug-16067-Remove-FastMmap.patch (text/plain), 3.92 KB, created by
Jonathan Druart
on 2020-11-25 14:51:16 UTC
(
hide
)
Description:
Bug 16067: Remove FastMmap
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-11-25 14:51:16 UTC
Size:
3.92 KB
patch
obsolete
>From cfe092d4bb2bde59b5a7e1502768a39336f61c20 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 17 Dec 2018 12:45:54 -0300 >Subject: [PATCH] Bug 16067: Remove FastMmap > >It is known to be broken, we should remove its implementation >--- > Koha/Cache.pm | 38 +------------------------------------- > cpanfile | 1 - > debian/control | 2 -- > t/db_dependent/Cache.t | 4 ---- > 4 files changed, 1 insertion(+), 44 deletions(-) > >diff --git a/Koha/Cache.pm b/Koha/Cache.pm >index 95d0e6ba1b..54fe72f81f 100644 >--- a/Koha/Cache.pm >+++ b/Koha/Cache.pm >@@ -51,7 +51,7 @@ use Koha::Config; > use base qw(Class::Accessor); > > __PACKAGE__->mk_ro_accessors( >- qw( cache memcached_cache fastmmap_cache memory_cache )); >+ qw( cache memcached_cache )); > > our %L1_cache; > our $L1_encoder = Sereal::Encoder->new; >@@ -94,15 +94,6 @@ sub new { > $self->{'cache'} = $self->{'memcached_cache'}; > } > >- if ( $self->{'default_type'} eq 'fastmmap' >- && defined( $ENV{GATEWAY_INTERFACE} ) >- && can_load( modules => { 'Cache::FastMmap' => undef } ) >- && _initialize_fastmmap($self) >- && defined( $self->{'fastmmap_cache'} ) ) >- { >- $self->{'cache'} = $self->{'fastmmap_cache'}; >- } >- > $ENV{DEBUG} && carp "Selected caching system: " . ($self->{'cache'} // 'none'); > > return >@@ -141,33 +132,6 @@ sub _initialize_memcached { > return $self; > } > >-sub _initialize_fastmmap { >- my ($self) = @_; >- my ($cache, $share_file); >- >- # Temporary workaround to catch fatal errors when: C4::Context module >- # is not loaded beforehand, or Cache::FastMmap init fails for whatever >- # other reason (e.g. due to permission issues - see Bug 13431) >- eval { >- $share_file = join( '-', >- "/tmp/sharefile-koha", $self->{'namespace'}, >- C4::Context->config('hostname'), C4::Context->config('database') ); >- >- $cache = Cache::FastMmap->new( >- 'share_file' => $share_file, >- 'expire_time' => $self->{'timeout'}, >- 'unlink_on_exit' => 0, >- ); >- }; >- if ( $@ ) { >- warn "FastMmap cache initialization failed: $@"; >- return; >- } >- return unless defined $cache; >- $self->{'fastmmap_cache'} = $cache; >- return $self; >-} >- > =head2 is_cache_active > > Routine that checks whether or not a default caching method is active on this >diff --git a/cpanfile b/cpanfile >index a65551f512..e757ac6b03 100644 >--- a/cpanfile >+++ b/cpanfile >@@ -135,7 +135,6 @@ recommends 'Archive::Extract', '0.60'; > recommends 'Archive::Zip', '1.30'; > recommends 'Array::Utils', '0.5'; > recommends 'CGI::Session::Driver::memcached', '0.04'; >-recommends 'Cache::FastMmap', '1.34'; > recommends 'DBD::SQLite2', '0.33'; > recommends 'Devel::Cover', '0.89'; > recommends 'File::Copy', '2.08'; >diff --git a/debian/control b/debian/control >index 85d04bb025..4a45c9c7ee 100644 >--- a/debian/control >+++ b/debian/control >@@ -20,7 +20,6 @@ Build-Depends: libalgorithm-checkdigits-perl, > libbusiness-isbn-perl, > libbusiness-issn-perl, > libbytes-random-secure-perl, >- libcache-fastmmap-perl, > libcache-memcached-fast-safe-perl, > libcache-memcached-perl, > libcgi-compile-perl, >@@ -259,7 +258,6 @@ Depends: libalgorithm-checkdigits-perl, > libbusiness-isbn-perl, > libbusiness-issn-perl, > libbytes-random-secure-perl, >- libcache-fastmmap-perl, > libcache-memcached-fast-safe-perl, > libcache-memcached-perl, > libcgi-compile-perl, >diff --git a/t/db_dependent/Cache.t b/t/db_dependent/Cache.t >index 3af4f6f9fd..e47393f22c 100755 >--- a/t/db_dependent/Cache.t >+++ b/t/db_dependent/Cache.t >@@ -284,9 +284,5 @@ END { > skip "Cache not enabled", 1 > unless ( $cache->is_cache_active() ); > is( $destructorcount, 1, 'Destructor run exactly once' ); >- # cleanup temporary file >- my $tmp_file = $cache->{ fastmmap_cache }->{ share_file }; >- unlink $tmp_file if defined $tmp_file; >- > } > } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16067
:
83304
|
113990
|
114003