diff -Nru libcache-memcached-perl-1.29/ChangeLog libcache-memcached-perl-1.30/ChangeLog --- libcache-memcached-perl-1.29/ChangeLog 2010-06-18 01:26:11.000000000 +0000 +++ libcache-memcached-perl-1.30/ChangeLog 2012-05-19 23:27:01.000000000 +0000 @@ -1,8 +1,23 @@ +2012-05-19: version 1.30 + + * Fix buck2sock corruption that causes errors like + "No map found matching for GLOB" or "No sock found for" (hachi@cpan.org) + https://rt.cpan.org/Ticket/Display.html?id=62872 + + * Fix t/05_reconnect_timeout.t to not fail on networks that fast-reject + TEST-NET-1 https://rt.cpan.org/Ticket/Display.html?id=74500 + + * Fix warning about undefined value in GetParser.pm (kost@ropnet.ru) + https://rt.cpan.org/Ticket/Display.html?id=31067 + + * Add documentation of connect_timeout and select_timeout + https://rt.cpan.org/Ticket/Display.html?id=30904 + 2010-06-17: version 1.29 - * fix warnings spew if calling stats on a down server + * fix warnings spew if calling stats on a down server - * fix buck2sock confusion (Eddie Canales) + * fix buck2sock confusion (Eddie Canales) * quell ipv6-related warning https://rt.cpan.org/Ticket/Display.html?id=51761 diff -Nru libcache-memcached-perl-1.29/debian/changelog libcache-memcached-perl-1.30/debian/changelog --- libcache-memcached-perl-1.29/debian/changelog 2010-06-20 13:56:13.000000000 +0000 +++ libcache-memcached-perl-1.30/debian/changelog 2012-06-08 19:15:19.000000000 +0000 @@ -1,3 +1,22 @@ +libcache-memcached-perl (1.30-1) unstable; urgency=low + + [ Ansgar Burchardt ] + * debian/control: Convert Vcs-* fields to Git. + + [ Fabrizio Regalli ] + * Update d/compat to 8 + * Update debhelper to (>=8.0) + + [ gregor herrmann ] + * New upstream release. + * Refresh patch (offset). + * debian/copyright: update to Copyright-Format 1.0. + * debian/copyright: update packaging copyright years, Tincho's email + address, license stanzas. + * Bump Standards-Version to 3.9.3 (no changes). + + -- gregor herrmann Fri, 08 Jun 2012 21:15:14 +0200 + libcache-memcached-perl (1.29-1) unstable; urgency=low * New upstream release. diff -Nru libcache-memcached-perl-1.29/debian/compat libcache-memcached-perl-1.30/debian/compat --- libcache-memcached-perl-1.29/debian/compat 2009-05-17 03:50:22.000000000 +0000 +++ libcache-memcached-perl-1.30/debian/compat 2012-06-08 19:15:19.000000000 +0000 @@ -1 +1 @@ -7 +8 diff -Nru libcache-memcached-perl-1.29/debian/control libcache-memcached-perl-1.30/debian/control --- libcache-memcached-perl-1.29/debian/control 2010-06-20 13:52:44.000000000 +0000 +++ libcache-memcached-perl-1.30/debian/control 2012-06-08 19:15:19.000000000 +0000 @@ -1,15 +1,15 @@ Source: libcache-memcached-perl Section: perl Priority: optional -Build-Depends: debhelper (>= 7) +Build-Depends: debhelper (>= 8) Build-Depends-Indep: perl, netbase, libstring-crc32-perl Maintainer: Debian Perl Group Uploaders: Jay Bonci , Jonathan Yu , gregor herrmann -Standards-Version: 3.8.4 +Standards-Version: 3.9.3 Homepage: http://search.cpan.org/dist/Cache-Memcached/ -Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libcache-memcached-perl/ -Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libcache-memcached-perl/ +Vcs-Git: git://git.debian.org/pkg-perl/packages/libcache-memcached-perl.git +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libcache-memcached-perl.git Package: libcache-memcached-perl Architecture: all diff -Nru libcache-memcached-perl-1.29/debian/copyright libcache-memcached-perl-1.30/debian/copyright --- libcache-memcached-perl-1.29/debian/copyright 2010-06-20 13:51:58.000000000 +0000 +++ libcache-memcached-perl-1.30/debian/copyright 2012-06-08 19:15:19.000000000 +0000 @@ -1,7 +1,7 @@ -Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 -Maintainer: Brad Fitzpatrick +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Cache-Memcached +Upstream-Contact: Brad Fitzpatrick Source: http://search.cpan.org/dist/Cache-Memcached/ -Name: Cache-Memcached Files: * Copyright: 2003-2007, Brad Fitzpatrick @@ -10,23 +10,24 @@ Files: debian/* Copyright: 2003, 2004, 2005, 2006, 2007, Jay Bonci 2007, Gunnar Wolf - 2007, Martín Ferrari - 2007, 2009, 2010, gregor herrmann + 2007, Martín Ferrari + 2007-2012, gregor herrmann 2009, Jonathan Yu License: Artistic or GPL-1+ +License: Artistic + This program is free software; you can redistribute it and/or modify + it under the terms of the Artistic License, which comes with Perl. + . + On Debian systems, the complete text of the Artistic License can be + found in `/usr/share/common-licenses/Artistic'. + License: GPL-1+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. . - On Debian GNU/Linux systems, the complete text of the GNU General - Public License can be found in `/usr/share/common-licenses/GPL' + On Debian systems, the complete text of version 1 of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL-1'. -License: Artistic - This program is free software; you can redistribute it and/or modify - it under the terms of the Artistic License, which comes with Perl. - . - On Debian GNU/Linux systems, the complete text of the Artistic License - can be found in `/usr/share/common-licenses/Artistic' diff -Nru libcache-memcached-perl-1.29/debian/patches/race.patch libcache-memcached-perl-1.30/debian/patches/race.patch --- libcache-memcached-perl-1.29/debian/patches/race.patch 2010-06-20 13:50:10.000000000 +0000 +++ libcache-memcached-perl-1.30/debian/patches/race.patch 2012-06-08 19:15:19.000000000 +0000 @@ -3,13 +3,13 @@ Forwarded: no Author: Niko Tyni Reviewed-by: gregor herrmann -Last-Update: 2010-06-20 +Last-Update: 2012-06-08 --- a/t/05_reconnect_timeout.t +++ b/t/05_reconnect_timeout.t -@@ -10,6 +10,9 @@ - - plan tests => 2; +@@ -32,6 +32,9 @@ + exit 0; + } +SKIP: { + skip "Skipping network tests for Debian builds", 2 if $ENV{DEBIAN_BUILD}; @@ -17,7 +17,7 @@ my $memd = Cache::Memcached->new({ servers => [ $testaddr ], namespace => "Cache::Memcached::t/$$/" . (time() % 100) . "/", -@@ -26,3 +29,5 @@ +@@ -48,3 +51,5 @@ $memd->set("key", "foo"); my $time3 = Time::HiRes::time(); ok($time3 - $time2 < .1, "Should return fast on retry"); diff -Nru libcache-memcached-perl-1.29/lib/Cache/Memcached/GetParser.pm libcache-memcached-perl-1.30/lib/Cache/Memcached/GetParser.pm --- libcache-memcached-perl-1.29/lib/Cache/Memcached/GetParser.pm 2007-11-20 06:42:06.000000000 +0000 +++ libcache-memcached-perl-1.30/lib/Cache/Memcached/GetParser.pm 2012-05-18 23:25:27.000000000 +0000 @@ -59,7 +59,7 @@ 128*1024, $self->[OFFSET]); return 0 if !defined($res) and $!==EWOULDBLOCK; - if ($res == 0) { + if (!defined($res) || $res == 0) { $self->[ON_ITEM] = undef; return -1; } diff -Nru libcache-memcached-perl-1.29/lib/Cache/Memcached.pm libcache-memcached-perl-1.30/lib/Cache/Memcached.pm --- libcache-memcached-perl-1.29/lib/Cache/Memcached.pm 2010-06-18 01:26:15.000000000 +0000 +++ libcache-memcached-perl-1.30/lib/Cache/Memcached.pm 2012-05-19 23:28:36.000000000 +0000 @@ -1,4 +1,4 @@ -# $Id: Memcached.pm 844 2010-06-18 01:26:15Z dormando $ +# $Id$ # # Copyright (c) 2003, 2004 Brad Fitzpatrick # @@ -26,7 +26,7 @@ bucketcount _single_sock _stime connect_timeout cb_connect_fail parser_class - buck2sock + buck2sock buck2sock_generation }; # flag definitions @@ -37,7 +37,7 @@ use constant COMPRESS_SAVINGS => 0.20; # percent use vars qw($VERSION $HAVE_ZLIB $FLAG_NOSIGNAL $HAVE_SOCKET6); -$VERSION = "1.29"; +$VERSION = "1.30"; BEGIN { $HAVE_ZLIB = eval "use Compress::Zlib (); 1;"; @@ -57,6 +57,7 @@ my %host_dead; # host -> unixtime marked dead until my %cache_sock; # host -> socket +my $socket_cache_generation = 1; # Set to 1 here because below the buck2sock_generation is set to 0, keep them in order. my $PROTO_TCP; @@ -69,6 +70,7 @@ my $args = (@_ == 1) ? shift : { @_ }; # hashref-ify args $self->{'buck2sock'}= []; + $self->{'buck2sock_generation'} = 0; $self->set_servers($args->{'servers'}); $self->{'debug'} = $args->{'debug'} || 0; $self->{'no_rehash'} = $args->{'no_rehash'}; @@ -102,7 +104,9 @@ $self->{'buckets'} = undef; $self->{'bucketcount'} = 0; $self->init_buckets; - $self->{'buck2sock'}= []; + + # We didn't close any sockets, so we reset the buck2sock generation, not increment the global socket cache generation. + $self->{'buck2sock_generation'} = 0; $self->{'_single_sock'} = undef; if (@{$self->{'servers'}} == 1) { @@ -155,7 +159,11 @@ sub forget_dead_hosts { my Cache::Memcached $self = shift; %host_dead = (); - $self->{'buck2sock'} = []; + + # We need to globally recalculate our buck2sock in all objects, so we increment the global generation. + $socket_cache_generation++; + + return 1; } sub set_stat_callback { @@ -175,7 +183,9 @@ delete $cache_sock{$ipport}; delete $sock_map{$sock}; } - $self->{'buck2sock'} = [] if $self; + # We need to globally recalculate our buck2sock in all objects, so we increment the global generation. + $socket_cache_generation++; + return $ret; # 0 or undef, probably, depending on what caller wants } @@ -186,7 +196,11 @@ delete $cache_sock{$ipport}; delete $sock_map{$sock}; } - $self->{'buck2sock'} = []; + + # We need to globally recalculate our buck2sock in all objects, so we increment the global generation. + $socket_cache_generation++; + + return 1; } sub _connect_sock { # sock, sin, timeout @@ -357,7 +371,9 @@ close $sock; } %cache_sock = (); - $self->{'buck2sock'} = []; + + # We need to globally recalculate our buck2sock in all objects, so we increment the global generation. + $socket_cache_generation++; } # writes a line, then reads result. by default stops reading after a @@ -604,6 +620,12 @@ } else { my $bcount = $self->{'bucketcount'}; my $sock; + + if ($self->{'buck2sock_generation'} != $socket_cache_generation) { + $self->{'buck2sock_generation'} = $socket_cache_generation; + $self->{'buck2sock'} = []; + } + KEY: foreach my $key (@_) { my ($hv, $real_key) = ref $key ? @@ -1021,6 +1043,10 @@ That is, if you set namespace to "app1:" and later do a set of "foo" to "bar", memcached is actually seeing you set "app1:foo" to "bar". +Use C and C to set connection and +polling timeouts. The C defaults to .25 second, and +the C defaults to 1 second. + The other useful key is C, which when set to true will produce diagnostics on STDERR. @@ -1052,6 +1078,14 @@ Sets the compression threshold. See C constructor for more information. +=item C + +Sets the connect timeout. See C constructor for more information. + +=item C + +Sets the select timeout. See C constructor for more information. + =item C Temporarily enable or disable compression. Has no effect if C diff -Nru libcache-memcached-perl-1.29/MANIFEST libcache-memcached-perl-1.30/MANIFEST --- libcache-memcached-perl-1.29/MANIFEST 2010-06-18 01:26:18.000000000 +0000 +++ libcache-memcached-perl-1.30/MANIFEST 2012-05-19 23:28:42.000000000 +0000 @@ -13,4 +13,6 @@ t/05_reconnect_timeout.t t/06_utf8_key.t t/100_flush_bug.t -META.yml Module meta-data (added by MakeMaker) +t/101_multiple_clients.t +META.yml Module YAML meta-data (added by MakeMaker) +META.json Module JSON meta-data (added by MakeMaker) diff -Nru libcache-memcached-perl-1.29/MANIFEST.SKIP libcache-memcached-perl-1.30/MANIFEST.SKIP --- libcache-memcached-perl-1.29/MANIFEST.SKIP 2007-11-20 06:42:06.000000000 +0000 +++ libcache-memcached-perl-1.30/MANIFEST.SKIP 2012-05-19 23:28:34.000000000 +0000 @@ -5,6 +5,7 @@ \bCVS\b ,v$ \B\.svn\b +\.git # Avoid Makemaker generated and utility files. \bMANIFEST\.bak diff -Nru libcache-memcached-perl-1.29/META.json libcache-memcached-perl-1.30/META.json --- libcache-memcached-perl-1.29/META.json 1970-01-01 00:00:00.000000000 +0000 +++ libcache-memcached-perl-1.30/META.json 2012-05-19 23:28:42.000000000 +0000 @@ -0,0 +1,44 @@ +{ + "abstract" : "client library for memcached (memory cache daemon)", + "author" : [ + "Brad Fitzpatrick " + ], + "dynamic_config" : 1, + "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112621", + "license" : [ + "unknown" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "Cache-Memcached", + "no_index" : { + "directory" : [ + "t", + "inc" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "ExtUtils::MakeMaker" : 0 + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : 0 + } + }, + "runtime" : { + "requires" : { + "Encode" : 0, + "Storable" : 0, + "String::CRC32" : 0, + "Time::HiRes" : 0 + } + } + }, + "release_status" : "stable", + "version" : "1.30" +} diff -Nru libcache-memcached-perl-1.29/META.yml libcache-memcached-perl-1.30/META.yml --- libcache-memcached-perl-1.29/META.yml 2010-06-18 01:26:18.000000000 +0000 +++ libcache-memcached-perl-1.30/META.yml 2012-05-19 23:28:41.000000000 +0000 @@ -1,25 +1,25 @@ ---- #YAML:1.0 -name: Cache-Memcached -version: 1.29 -abstract: client library for memcached (memory cache daemon) +--- +abstract: 'client library for memcached (memory cache daemon)' author: - - Brad Fitzpatrick -license: unknown -distribution_type: module -configure_requires: - ExtUtils::MakeMaker: 0 + - 'Brad Fitzpatrick ' build_requires: - ExtUtils::MakeMaker: 0 -requires: - Encode: 0 - Storable: 0 - String::CRC32: 0 - Time::HiRes: 0 -no_index: - directory: - - t - - inc -generated_by: ExtUtils::MakeMaker version 6.55_02 + ExtUtils::MakeMaker: 0 +configure_requires: + ExtUtils::MakeMaker: 0 +dynamic_config: 1 +generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112621' +license: unknown meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 +name: Cache-Memcached +no_index: + directory: + - t + - inc +requires: + Encode: 0 + Storable: 0 + String::CRC32: 0 + Time::HiRes: 0 +version: 1.30 diff -Nru libcache-memcached-perl-1.29/t/05_reconnect_timeout.t libcache-memcached-perl-1.30/t/05_reconnect_timeout.t --- libcache-memcached-perl-1.29/t/05_reconnect_timeout.t 2010-06-18 01:24:17.000000000 +0000 +++ libcache-memcached-perl-1.30/t/05_reconnect_timeout.t 2012-05-19 23:25:41.000000000 +0000 @@ -4,11 +4,33 @@ use Test::More; use Cache::Memcached; use IO::Socket::INET; -use Time::HiRes; +use Time::HiRes qw(gettimeofday tv_interval); +############################################################################## +# This is connecting to TEST-NET-1 on purpose, because that's a space that is +# guaranteed by RFC to have no hosts in it. Sometimes we still get fast RST +# frames though, so we have to check before we trust it. +# +# DO NOT FIX THIS CODE TO CHECK AND MAKE SURE THE HOST IS UP. IT IS SUPPOSED +# TO BE DOWN. :) --hachi +############################################################################## my $testaddr = "192.0.2.1:11211"; -plan tests => 2; +my $stime = [gettimeofday]; + +my $msock = IO::Socket::INET->new( + PeerAddr => $testaddr, + Timeout => 2, +); + +my $delta_t = tv_interval($stime); + +if ($delta_t >= 1) { + plan tests => 2; +} else { + plan skip_all => "Somehow we got a fast return when connecting to $testaddr\n"; + exit 0; +} my $memd = Cache::Memcached->new({ servers => [ $testaddr ], diff -Nru libcache-memcached-perl-1.29/t/101_multiple_clients.t libcache-memcached-perl-1.30/t/101_multiple_clients.t --- libcache-memcached-perl-1.29/t/101_multiple_clients.t 1970-01-01 00:00:00.000000000 +0000 +++ libcache-memcached-perl-1.30/t/101_multiple_clients.t 2012-05-19 23:18:20.000000000 +0000 @@ -0,0 +1,55 @@ +#!/usr/bin/env perl -w + +use strict; +use Test::More; +use Cache::Memcached; +use IO::Socket::INET; + +my $testaddr = "127.0.0.1:11211"; +my $sock = IO::Socket::INET->new( + PeerAddr => $testaddr, + Proto => 'tcp', + ReuseAddr => 1, +); + +if ($sock) { + plan tests => 8; +} else { + plan skip_all => "cannot connect to $testaddr\n"; + exit 0; +} +close $sock; + +my $mc = Cache::Memcached->new( + servers => [ '127.0.0.1:11211', '127.1:11211' ], +); + +$mc->get('1'); +pass("1-1"); + +$mc->get('2'); +pass("1-2"); + +my $mc2 = Cache::Memcached->new( + servers => [ '127.0.0.1:11211', '127.1:11211' ], +); + +$mc2->get('1'); +pass("2-1"); + +$mc->get('1'); +pass("2-2"); + +$mc->disconnect_all(); + +$mc2->get('1'); +pass("2-1"); + +$mc->get('1'); +pass("2-2"); + +$mc->get('2'); +pass("2-3"); + +$mc2->get('2'); +pass("2-4");