[Koha-bugs] [Bug 13193] Make Memcached usage fork safe

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Sep 18 02:48:36 CEST 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13193

--- Comment #25 from David Cook <dcook at prosentient.com.au> ---
(In reply to Martin Renvoize from comment #23)
> I'm wondering if it's worthwhile effectively porting the test from
> Cache::Memcached::Fast::Safe for forking:
> https://metacpan.org/source/KAZEBURO/Cache-Memcached-Fast-Safe-0.06/t/
> 02_fork.t.
> 
> It doesn't test our particular case, but, assuming it's right, should catch
> cases of missed calls to disconnect_all (which ::Safe does for us here).. in
> that way we should catch failures if someone down the line decides to remove
> the ::Safe module without fully understanding why we were using it.
> 
> Thoughts?

To be honest, that test looks pretty useless, as a barebones implementation
using Cache::Memcached::Fast doesn't show any errors. 

use strict;
use warnings;
use Cache::Memcached::Fast;
use Data::Dumper;
my $cache = Cache::Memcached::Fast->new({
    servers => ["localhost:11211"],
});
my $version = $cache->server_versions;
warn Dumper($version);
my $pid = fork;
if ( $pid == 0 ){
    my $after_fork = $cache->server_versions;
    warn Dumper($after_fork)
}
waitpid($pid,0);

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list