Subject: | disconnect_all does not clear @buck2sock |
The list @buck2suck is not cleared when disconnect_all() is called.
If you use more than one memcached server references to stale sockets
stay in the list, which cause Cache::Memcached to die with the message
No sock found for server1:11211 at /usr/share/perl5/Cache/Memcached.pm
line 672
on the next call to get(). This code triggers the bug:
#!/usr/bin/perl
use Cache::Memcached;
my $memd = Cache::Memcached->new( {
servers => [ 'server1:11211', 'server2:11211' ],
} );
$memd->get( 'some_key' );
$memd->disconnect_all;
$memd->get( 'some_key' );
Fix attached.
Subject: | c-m-no-sock-fix.diff |
--- Memcached.pm 2009-04-29 16:27:49.000000000 +0200
+++ Memcached.pm.fixed 2009-04-29 16:27:56.000000000 +0200
@@ -328,6 +328,7 @@
close $sock;
}
%cache_sock = ();
+ @buck2sock = ();
}
# writes a line, then reads result. by default stops reading after a