Coder Social home page Coder Social logo

shogo82148 / redis-fast Goto Github PK

View Code? Open in Web Editor NEW
25.0 5.0 21.0 937 KB

fast perl binding for Redis database

Home Page: https://metacpan.org/release/Redis-Fast

License: Other

Perl 74.99% XS 25.01%
redis perl redis-database amazon-elasticache

redis-fast's Introduction

Actions Status MetaCPAN Release

NAME

Redis::Fast - Perl binding for Redis database

SYNOPSIS

## Defaults to $ENV{REDIS_SERVER} or 127.0.0.1:6379
my $redis = Redis::Fast->new;

my $redis = Redis::Fast->new(server => 'redis.example.com:8080');

## Set the connection name (requires Redis 2.6.9)
my $redis = Redis::Fast->new(
  server => 'redis.example.com:8080',
  name => 'my_connection_name',
);
my $generation = 0;
my $redis = Redis::Fast->new(
  server => 'redis.example.com:8080',
  name => sub { "cache-$$-".++$generation },
);

## Use Sentinels, possibly with password
my $redis = Redis::Fast->new(
  sentinels => [ '10.0.0.1:16379', '10.0.0.2:16379', ],
  service   => 'mymaster',
  sentinels_password => 'TheB1gS3CR3T', # optional
);

## Use UNIX domain socket
my $redis = Redis::Fast->new(sock => '/path/to/socket');

## Enable auto-reconnect
## Try to reconnect every 500ms up to 60 seconds until success
## Die if you can't after that
my $redis = Redis::Fast->new(reconnect => 60, every => 500_000);

## Try each 100ms up to 2 seconds (every is in microseconds)
my $redis = Redis::Fast->new(reconnect => 2, every => 100_000);

## Disable the automatic utf8 encoding => much more performance
## !!!! This will be the default after 2.000, see ENCODING below
my $redis = Redis::Fast->new(encoding => undef);

## Use all the regular Redis commands, they all accept a list of
## arguments
## See http://redis.io/commands for full list
$redis->get('key');
$redis->set('key' => 'value');
$redis->sort('list', 'DESC');
$redis->sort(qw{list LIMIT 0 5 ALPHA DESC});

## Add a coderef argument to run a command in the background
$redis->sort(qw{list LIMIT 0 5 ALPHA DESC}, sub {
  my ($reply, $error) = @_;
  die "Oops, got an error: $error\n" if defined $error;
  print "$_\n" for @$reply;
});
long_computation();
$redis->wait_all_responses;
## or
$redis->wait_one_response();

## Or run a large batch of commands in a pipeline
my %hash = _get_large_batch_of_commands();
$redis->hset('h', $_, $hash{$_}, sub {}) for keys %hash;
$redis->wait_all_responses;

## Publish/Subscribe
$redis->subscribe(
  'topic_1',
  'topic_2',
  sub {
    my ($message, $topic, $subscribed_topic) = @_

      ## $subscribed_topic can be different from topic if
      ## you use psubscribe() with wildcards
  }
);
$redis->psubscribe('nasdaq.*', sub {...});

## Blocks and waits for messages, calls subscribe() callbacks
##  ... forever
my $timeout = 10;
$redis->wait_for_messages($timeout) while 1;

##  ... until some condition
my $keep_going = 1; ## other code will set to false to quit
$redis->wait_for_messages($timeout) while $keep_going;

$redis->publish('topic_1', 'message');

DESCRIPTION

Redis::Fast is a wrapper around Salvatore Sanfilippo's hiredis C client. It is compatible with Redis.pm.

This version supports protocol 2.x (multi-bulk) or later of Redis available at https://github.com/antirez/redis/.

Reconnect on error

Besides auto-reconnect when the connection is closed, Redis::Fast supports reconnecting on the specified errors by the reconnect_on_error option. Here's an example that will reconnect when receiving READONLY error:

my $r = Redis::Fast->new(
  reconnect          => 1, # The value greater than 0 is required
  reconnect_on_error => sub {
    my ($error, $ret, $command) = @_;
    if ($error =~ /READONLY You can't write against a read only slave/) {
      # force reconnect
      return 1;
    }
    # do nothing
    return -1;
  },
);

This feature is useful when using Amazon ElastiCache. Once failover happens, Amazon ElastiCache will switch the master we currently connected with to a slave, leading to the following writes fails with the error READONLY. Using reconnect_on_error, we can force the connection to reconnect on this error in order to connect to the new master. If your Elasticache Redis is enabled to be set an option for close-on-slave-write, this feature might be unnecessary.

The return value of reconnect_on_error should be greater than -2. -1 means that Redis::Fast behaves the same as without this option. 0 and greater than 0 means that Redis::Fast forces to reconnect and then wait for a next force reconnect until this value seconds elapse. This unit is a second, and the type is double. For example, 0.01 means 10 milliseconds.

Note: This feature is not supported for the subscribed mode.

PERFORMANCE IN SYNCHRONIZE MODE

Redis.pm

Benchmark: running 00_ping, 10_set, 11_set_r, 20_get, 21_get_r, 30_incr, 30_incr_r, 40_lpush, 50_lpop, 90_h_get, 90_h_set for at least 5 CPU seconds...
   00_ping:  8 wallclock secs ( 0.69 usr +  4.77 sys =  5.46 CPU) @ 5538.64/s (n=30241)
    10_set:  8 wallclock secs ( 1.07 usr +  4.01 sys =  5.08 CPU) @ 5794.09/s (n=29434)
  11_set_r:  7 wallclock secs ( 0.42 usr +  4.84 sys =  5.26 CPU) @ 5051.33/s (n=26570)
    20_get:  8 wallclock secs ( 0.69 usr +  4.82 sys =  5.51 CPU) @ 5080.40/s (n=27993)
  21_get_r:  7 wallclock secs ( 2.21 usr +  3.09 sys =  5.30 CPU) @ 5389.06/s (n=28562)
   30_incr:  7 wallclock secs ( 0.69 usr +  4.73 sys =  5.42 CPU) @ 5671.77/s (n=30741)
 30_incr_r:  7 wallclock secs ( 0.85 usr +  4.31 sys =  5.16 CPU) @ 5824.42/s (n=30054)
  40_lpush:  8 wallclock secs ( 0.60 usr +  4.77 sys =  5.37 CPU) @ 5832.59/s (n=31321)
   50_lpop:  7 wallclock secs ( 1.24 usr +  4.17 sys =  5.41 CPU) @ 5112.75/s (n=27660)
  90_h_get:  7 wallclock secs ( 0.63 usr +  4.65 sys =  5.28 CPU) @ 5716.29/s (n=30182)
  90_h_set:  7 wallclock secs ( 0.65 usr +  4.74 sys =  5.39 CPU) @ 5593.14/s (n=30147)

Redis::Fast

Redis::Fast is 50% faster than Redis.pm.

Benchmark: running 00_ping, 10_set, 11_set_r, 20_get, 21_get_r, 30_incr, 30_incr_r, 40_lpush, 50_lpop, 90_h_get, 90_h_set for at least 5 CPU seconds...
   00_ping:  9 wallclock secs ( 0.18 usr +  4.84 sys =  5.02 CPU) @ 7939.24/s (n=39855)
    10_set: 10 wallclock secs ( 0.31 usr +  5.40 sys =  5.71 CPU) @ 7454.64/s (n=42566)
  11_set_r:  9 wallclock secs ( 0.31 usr +  4.87 sys =  5.18 CPU) @ 7993.05/s (n=41404)
    20_get: 10 wallclock secs ( 0.27 usr +  4.84 sys =  5.11 CPU) @ 8350.68/s (n=42672)
  21_get_r: 10 wallclock secs ( 0.32 usr +  5.17 sys =  5.49 CPU) @ 8238.62/s (n=45230)
   30_incr:  9 wallclock secs ( 0.23 usr +  5.27 sys =  5.50 CPU) @ 8221.82/s (n=45220)
 30_incr_r:  8 wallclock secs ( 0.28 usr +  4.91 sys =  5.19 CPU) @ 8092.29/s (n=41999)
  40_lpush:  9 wallclock secs ( 0.18 usr +  5.06 sys =  5.24 CPU) @ 8312.02/s (n=43555)
   50_lpop:  9 wallclock secs ( 0.20 usr +  4.84 sys =  5.04 CPU) @ 8010.12/s (n=40371)
  90_h_get:  9 wallclock secs ( 0.19 usr +  5.51 sys =  5.70 CPU) @ 7467.72/s (n=42566)
  90_h_set:  8 wallclock secs ( 0.28 usr +  4.83 sys =  5.11 CPU) @ 7724.07/s (n=39470)o

PERFORMANCE IN PIPELINE MODE

#!/usr/bin/perl
use warnings;
use strict;
use Time::HiRes qw/time/;
use Redis;

my $count = 100000;
{
    my $r = Redis->new;
    my $start = time;
    for(1..$count) {
        $r->set('hoge', 'fuga', sub{});
    }
    $r->wait_all_responses;
    printf "Redis.pm:\n%.2f/s\n", $count / (time - $start);
}

{
    my $r = Redis::Fast->new;
    my $start = time;
    for(1..$count) {
        $r->set('hoge', 'fuga', sub{});
    }
    $r->wait_all_responses;
    printf "Redis::Fast:\n%.2f/s\n", $count / (time - $start);
}

Redis::Fast is 4x faster than Redis.pm in pipeline mode.

Redis.pm:
22588.95/s
Redis::Fast:
81098.01/s

AUTHOR

Ichinose Shogo [email protected]

SEE ALSO

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

redis-fast's People

Contributors

andk avatar arc avatar avar avatar benevolent0505 avatar celogeek avatar dams avatar dependabot[bot] avatar dpavlin avatar guimard avatar jlavallee avatar jluis avatar jraspass avatar mbeijen avatar melo avatar michaelklishin avatar nise-nabe avatar polettix avatar rgs avatar shogo82148 avatar songmu avatar sunnavy avatar syohex avatar thiagorondon avatar thomas-netcraft avatar tsee avatar vkroll avatar vsespb avatar wsddn avatar xtab avatar yoheimuta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

redis-fast's Issues

Crash: LOADING Redis is loading the dataset in memory

use strict;
use warnings;
use Redis::Fast;
my $redis = Redis::Fast->new(
server => 'localhost:6379',
reconnect=>10,
every => 100_000,
cnx_timeout   => 10,
read_timeout  => 3,
write_timeout => 3,
#on_connect => sub { while ($_[0]->info("persistence")->{loading}) {sleep 1 } }
);

for (1..100_000) { # adjust me
  $redis->set("test_$_", "x" x 10_000);
}

print STDERR "Please restart redis\n";

while () {
  $redis->get("test_1");
  sleep 1;
}

crashes with

[get] LOADING Redis is loading the dataset in memory,  at /usr/local/lib/perl/5.14.2/Redis/Fast.pm line 179.
    Redis::Fast::__ANON__(Redis::Fast=SCALAR(0x13a65f8), "test_1") called at ZF.pl line 21

which makes reconnect feature useless. if I uncomment on_connect callback, everything works.

Note that Redis.pm in that case does not work at all.

Reconnect behaviour differs from cpan Redis module

so, script:

use strict;
use warnings;
use Redis::Fast;
my $redis = Redis::Fast->new(
    server => 'localhost:6379',
    reconnect=>20,
    every => 100,
    cnx_timeout   => 10,
    read_timeout  => 3,
    write_timeout => 3,
);

while() {
    eval {
        $redis->get(42);
        print "works\n";
    } or do {
        print "err: $@"
    };
    sleep 1;
}

will print the following:

$ perl redispoc.pl 
works
works
works
works
works
err: Could not connect to Redis server at localhost:6379 at /usr/local/lib/x86_64-linux-gnu/perl/5.24.1/Redis/Fast.pm line 265.
err: Not connected to any server at /usr/local/lib/x86_64-linux-gnu/perl/5.24.1/Redis/Fast.pm line 265.
err: Not connected to any server at /usr/local/lib/x86_64-linux-gnu/perl/5.24.1/Redis/Fast.pm line 265.
err: Not connected to any server at /usr/local/lib/x86_64-linux-gnu/perl/5.24.1/Redis/Fast.pm line 265.
err: Not connected to any server at /usr/local/lib/x86_64-linux-gnu/perl/5.24.1/Redis/Fast.pm line 265.
err: Not connected to any server at /usr/local/lib/x86_64-linux-gnu/perl/5.24.1/Redis/Fast.pm line 265.
err: Not connected to any server at /usr/local/lib/x86_64-linux-gnu/perl/5.24.1/Redis/Fast.pm line 265.

if I stop redis server (after that first err: Could not connect to Redis server line emited), and then start it in a few minutes (after all reconnect attemts exhaused) $redis connect does not work even with live Redis server, it still emits "err: Not connected to any server".

In contrast behaviour with Redis module:

$ perl redispoc.pl 
works
works
works
works
works
works
works
works
works
err: Could not connect to Redis server at localhost:6379: Connection refused at /usr/local/share/perl/5.24.1/Redis.pm line 268.
	...propagated at /usr/local/share/perl/5.24.1/Redis.pm line 606.
err: Could not connect to Redis server at localhost:6379: Connection refused at /usr/local/share/perl/5.24.1/Redis.pm line 268.
	...propagated at /usr/local/share/perl/5.24.1/Redis.pm line 606.
works
works
works
works
works

i.e. the handle still can be used after redis server up.

Not sure which behaviour is more correct, but the fact is they differs.

Also our use case when we prefer Redis module behaviour:
we have long running daemons and if redis server down for several minutes we have to restart all daemons and cannot use reconnect feature, or we have to write special code in every eval after which we would want to connect again.

manpage missing WHATIS entry

Hi,

the following trivial patch adds NAME sections to the man pages which causes them to be correctly attached to the WHATIS stuff.

--- a/lib/Redis/Fast/Sentinel.pm
+++ b/lib/Redis/Fast/Sentinel.pm
@@ -35,6 +35,10 @@ sub get_masters {

 __END__

+=head1 NAME
+
+    Redis::Fast::Sentinel - connect to a Sentinel instance
+
 =head1 SYNOPSIS

     my $sentinel = Redis::Fast::Sentinel->new( ... );
--- a/lib/Redis/Fast/List.pm
+++ b/lib/Redis/Fast/List.pm
@@ -85,6 +85,10 @@ sub DESTROY { $_[0]->quit }

 1;    ## End of Redis::List

+=head1 NAME
+
+    Redis::List - tie Perl arrays to Redis lists
+
 =head1 SYNOPSYS

     tie @my_list, 'Redis::List', 'list_name', @Redis_new_parameters;
--- a/lib/Redis/Fast/Hash.pm
+++ b/lib/Redis/Fast/Hash.pm
@@ -67,6 +67,9 @@ sub CLEAR {

 1;    ## End of Redis::Hash

+=head1 NAME
+
+    Redis::Hash - tie Perl hashes to Redis hashes

 =head1 SYNOPSYS

UB in DESTROY

Safefree(self);
DEBUG_MSG("%s", "finish");

Cause of UB on check ( self is undefined )

#define DEBUG_MSG(fmt, ...) \
    if (self->debug) {

Use Alien::hiredis?

I created Alien::hiredis which is an Alien wrapper of the hiredis library for other modules to use. I wondered if you might consider using it as it confers a few advantages over the current build. It can use a system hiredis library if it's a sufficient version instead of building a new one; it can seamlessly handle things like making gmake available; and it separates those concerns of making the library available and keeping it up to date from this distribution (either via the system version or the version installed by Alien::hiredis).

The process of allowing or building versions of hiredis is controlled by the alienfile. Right now it allows any version 0.11.0 or newer and disallows 0.13.0 because of bugs in that version, but this can be adjusted. The only other consumer at present is Protocol::Redis::XS and I am open to suggestions for adjusting the system library versions allowed. Your usage of the Alien can also specify additional version restrictions, but you can only cause your Build.PL to abort, the decision to use the system version or build a new version occurs when installing Alien::hiredis.

The simple usage of the Alien is described in Alien::Build::Manual::AlienUser, Alien::Base::Wrapper and Alien::hiredis would be added as a configure dependency and then Alien::Base::Wrapper is used to provide the necessary Module::Build arguments to build against it.

There is also the option of dynamically requiring Alien::hiredis only in certain conditions which is more complex but affords more control to this distribution's build process.

Thanks for your consideration.

53-timeout-length.t failures

a person reported

#   Failed test 'not too long'
#   at t/53-timeout-length.t line 20.
#     '6.029157'
#         <
#     '6'
# Looks like you failed 1 test of 2.

in 0.11,

failing all the time.

Debian 7. I can't reproduce under Ubuntu.
Redis server version 2.8.9

maybe you have ideas?

Upgrade hiredis to 0.12.1

Hi,

Can you concider to upgrade hiredis to v0.12.1 ?

This drivers is faster, safer I guess.

When I try to upgrade, the 03/pubsub.t lauch forever

Thanks

t/11-timeout.t fails with non-English locale

I observe the following test failure if a German locale (LC_ALL=de_DE.UTF-8) is set:

    #   Failed test 'the code died as expected'
    #   at t/11-timeout.t line 32.
    #                   'Error while reading from Redis server: Die Ressource ist zur Zeit nicht verfรƒยผgbar at /tmpfs/.cpan-build/2015121006/Redis-Fast-0.16-tfk2Tt/blib/lib/Redis/Fast.pm line 212.
    # '
    #     doesn't match '(?^u:Error while reading from Redis server: Die Wartezeit fรผr die Verbindung ist abgelaufen|Error while reading from Redis server: Die Ressource ist zur Zeit nicht verfรผgbar)'
    # Looks like you failed 1 test of 2.

#   Failed test 'server doesn't replies quickly enough'
#   at t/11-timeout.t line 35.
# Looks like you failed 1 test of 3.
t/11-timeout.t ............ 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/3 subtests 

password.t fails

error message is incorrect. i will fix it in next version.

#   Failed test 'but cannot execute any command except `auth`'
#   at t/53-password.t line 26.
#                   '[get] ERR operation not permitted,  at /home/ichinose/.cpanm/work/1413953653.19761/Redis-Fast-0.13/blib/lib/Redis/Fast.pm line 213.
#   Redis::Fast::__ANON__('Redis::Fast=SCALAR(0x13adb70)', 'foo') called at t/53-password.t line 25
#   main::__ANON__() called at /home/ichinose/.plenv/versions/5.16.3/lib/perl5/site_perl/5.16.3/Test/Fatal.pm line 23
#   Test::Fatal::__ANON__() called at /home/ichinose/.plenv/versions/5.16.3/lib/perl5/site_perl/5.16.3/Try/Tiny.pm line 71
#   eval {...} called at /home/ichinose/.plenv/versions/5.16.3/lib/perl5/site_perl/5.16.3/Try/Tiny.pm line 67
#   Try::Tiny::try('CODE(0x107a338)', 'Try::Tiny::Catch=REF(0x13138e0)') called at /home/ichinose/.plenv/versions/5.16.3/lib/perl5/site_perl/5.16.3/Test/Fatal.pm line 30
#   Test::Fatal::exception('CODE(0x107a2a8)') called at t/53-password.t line 26
#   main::__ANON__() called at /home/ichinose/.plenv/versions/5.16.3/lib/perl5/5.16.3/Test/Builder.pm line 258
#   Test::Builder::__ANON__() called at /home/ichinose/.plenv/versions/5.16.3/lib/perl5/5.16.3/Test/Builder.pm line 263
#   eval {...} called at /home/ichinose/.plenv/versions/5.16.3/lib/perl5/5.16.3/Test/Builder.pm line 263
#   Test::Builder::subtest('Test::Builder=HASH(0x8523c8)', 'no password', 'CODE(0x13ad840)') called at /home/ichinose/.plenv/versions/5.16.3/lib/perl5/5.16.3/Test/More.pm line 770
#   Test::More::subtest('no password', 'CODE(0x13ad840)') called at t/53-password.t line 29
# '
#     doesn't match '(?^:\[get\] NOAUTH Authentication required)'
# Looks like you failed 1 test of 2.

Redis version is 2.6.12

Redis server v=2.6.12 sha=00000000:0 malloc=jemalloc-3.2.0 bits=64

Undeclared dependencies (Redis-Fast-0.17)

t/02-responses.t fails if Parallel::ForkManager or Test::UNIXSock are not installed. Probably these should be either declared or the test should be skipped if these are missing.

Pipeline mode (wait_all_responses) issue with ttl and data

When using Redis::Fast in pipeline mode with wait_all_responses command we found some strange behavior.

We expect that in case of network connectivity issues/redis server going down, redis instance in perl script/module will wait for timeout and then crash if all reconnect attempts fail in specified time interval.

However, that's not the case when we are in the pipeline mode. Just after the redis goes down, wait_all_responses() returns last actual TTL and data for the specified key, then waits for timeout and then crashes with Redis server connect error.

No error is saved in the $error variable in the callback passed to Redis::Fast ttl and get commands. Neither does the Redis::Fast instance crash just after redis connection is lost as it could have been expected.

Is this supposed behavior?

Here is PoC

#!/usr/bin/perl

use Redis::Fast;
use Data::Dumper;

my $redis_host = "redis:6379";

my $redis = Redis::Fast->new(
    server        => $redis_host,
    reconnect     => 1,
    every         => 100_000,
    cnx_timeout   => 1,
    read_timeout  => 10,
    write_timeout => 10,
    encoding      => undef,
    select        => 'cache',
);

my $test_key = "RedisTestKey";

my ($data, $ttl, $error);

$redis->set( $test_key => 'value' );
$redis->expire( $test_key, 60 );

sub get_data_from_redis {
    my ($key) = @_;

    $redis->get( $key,      sub { $data = $_[0]; $error //= $_[1];  } );
    $redis->ttl( $key,      sub { $ttl = $_[0];  $error //= $_[1];  } );
    $redis->wait_all_responses();

    print Dumper(
        {
            data     => $data,
            ttl      => $ttl,
            error    => $error,
            eval_err => $@,
        }
    );

    return $data, $ttl;
}

while (1) {
    my ( $cached_data, $current_ttl ) = get_data_from_redis( $test_key );
    print Dumper( { cached_data => $cached_data, current_ttl => $current_ttl } );

    sleep(3);
}

terminal output when running this script:

# start script in terminal tab1
 
โžœ  ~  perl test2.pl
 
 
$VAR1 = {
          'eval_err' => '',
          'error' => undef,
          'data' => 'value',
          'ttl' => 60
        };
$VAR1 = {
          'cached_data' => 'value',
          'current_ttl' => 60
        };
 
$VAR1 = {
          'eval_err' => '',
          'data' => 'value',
          'error' => undef,
          'ttl' => 57
        };
$VAR1 = {
          'cached_data' => 'value',
          'current_ttl' => 57
        };
 
 
$VAR1 = {
          'eval_err' => '',
          'data' => 'value',
          'error' => undef,
          'ttl' => 54
        };
$VAR1 = {
          'current_ttl' => 54,
          'cached_data' => 'value'
        };
 
# stop redis service/container in parallel opened tab2
 
 
$VAR1 = {
          'eval_err' => '',
          'data' => 'value',
          'error' => undef,
          'ttl' => 54
        };
$VAR1 = {
          'current_ttl' => 54,
          'cached_data' => 'value'
        };
 
# timeout 1s
 
Could not connect to Redis server at redis:6379 at /usr/local/lib/x86_64-linux-gnu/perl/5.26.1/Redis/Fast.pm line 264.
 
# redis instance crashes, but just before that last actual TTL and data are returned.

@vaneska @TatyanaUstinova

Bad signal handling during blocking operation

We discovered that Redis::Fast in some circumstances behaves badly when receiving signal during blocking operation (e.g. brpop).

Following code works ok when it receives signal 15 during brpop:

perl -MRedis::Fast -E 'my $c = Redis::Fast->new(reconnect=>2, every => 100, server => "localhost:6379"); $c->select("db"); $c->brpop("a", 100); '

Just adding $SIG{TERM} = sub {} (actual content of this sub does not matter) makes it ignore first TERM signal received and reissue brpop command (it appears it trigger reconnect code) second TERM signal crashes this program. ("double free").

When there is no reconnect enabled problem does not appear, so one needs to have both reconnect and some TERM singnal handler installed to reproduce it.

Tested on 0.08 with perl 5.10.1 and 5.16
I compiled Redis::Fast with DEBUG enabled and reproduced this issue - see below

$ perl -MRedisast -E '$SIG{TERM}= sub {warn "TERM handler called"}; my $c =->new(reconnect=>2, every => 100, server => "localhost:6379"); $c->select("db"); $c->brpop("a", 100); '
[lib/Redis/Fast.xs:668:XS_Redis__Fast__new]: start
[lib/Redis/Fast.xs:673:XS_Redis__Fast__new]: return 0x1683d30
[lib/Redis/Fast.xs:299:Redis__Fast_connect]: start
[lib/Redis/Fast.xs:232:__build_sock]: start
[lib/Redis/Fast.xs:177:wait_for_event]: select start, timeout is 0.100000
[lib/Redis/Fast.xs:182:wait_for_event]: select returns 1
[lib/Redis/Fast.xs:197:wait_for_event]: ready to write
[lib/Redis/Fast.xs:201:wait_for_event]: finish
[lib/Redis/Fast.xs:277:__build_sock]: finsih
[lib/Redis/Fast.xs:329:Redis__Fast_connect]: finish
[lib/Redis/Fast.xs:352:Redis__Fast_reconnect]: start
[lib/Redis/Fast.xs:360:Redis__Fast_reconnect]: finish
[lib/Redis/Fast.xs:550:Redis__Fast_run_cmd]: start SELECT
[lib/Redis/Fast.xs:552:Redis__Fast_run_cmd]: pid check: previous pid is 20468, now 20468
[lib/Redis/Fast.xs:580:Redis__Fast_run_cmd]: send command in sync mode
[lib/Redis/Fast.xs:585:Redis__Fast_run_cmd]: waiting response
[lib/Redis/Fast.xs:283:_wait_all_responses]: start
[lib/Redis/Fast.xs:177:wait_for_event]: select start, timeout is -1.000000
[lib/Redis/Fast.xs:182:wait_for_event]: select returns 1
[lib/Redis/Fast.xs:197:wait_for_event]: ready to write
[lib/Redis/Fast.xs:201:wait_for_event]: finish
[lib/Redis/Fast.xs:177:wait_for_event]: select start, timeout is -1.000000
[lib/Redis/Fast.xs:182:wait_for_event]: select returns 1
[lib/Redis/Fast.xs:193:wait_for_event]: ready to read
[lib/Redis/Fast.xs:423:Redis__Fast_sync_reply_cb]: 0x168fe00
[lib/Redis/Fast.xs:439:Redis__Fast_sync_reply_cb]: finish
[lib/Redis/Fast.xs:201:wait_for_event]: finish
[lib/Redis/Fast.xs:291:_wait_all_responses]: finish
[lib/Redis/Fast.xs:590:Redis__Fast_run_cmd]: finish SELECT
[lib/Redis/Fast.xs:352:Redis__Fast_reconnect]: start
[lib/Redis/Fast.xs:360:Redis__Fast_reconnect]: finish
[lib/Redis/Fast.xs:550:Redis__Fast_run_cmd]: start BRPOP
[lib/Redis/Fast.xs:552:Redis__Fast_run_cmd]: pid check: previous pid is 20468, now 20468
[lib/Redis/Fast.xs:580:Redis__Fast_run_cmd]: send command in sync mode
[lib/Redis/Fast.xs:585:Redis__Fast_run_cmd]: waiting response
[lib/Redis/Fast.xs:283:_wait_all_responses]: start
[lib/Redis/Fast.xs:177:wait_for_event]: select start, timeout is -1.000000
[lib/Redis/Fast.xs:182:wait_for_event]: select returns 1
[lib/Redis/Fast.xs:197:wait_for_event]: ready to write
[lib/Redis/Fast.xs:201:wait_for_event]: finish
[lib/Redis/Fast.xs:177:wait_for_event]: select start, timeout is -1.000000

##### HERE IT WAITS FOR brpop to return something, but we send it signal 15 

[lib/Redis/Fast.xs:182:wait_for_event]: select returns -1
[lib/Redis/Fast.xs:189:wait_for_event]: exception!!
[lib/Redis/Fast.xs:287:_wait_all_responses]: error: 2
[lib/Redis/Fast.xs:352:Redis__Fast_reconnect]: start
[lib/Redis/Fast.xs:360:Redis__Fast_reconnect]: finish
[lib/Redis/Fast.xs:580:Redis__Fast_run_cmd]: send command in sync mode
[lib/Redis/Fast.xs:585:Redis__Fast_run_cmd]: waiting response
[lib/Redis/Fast.xs:283:_wait_all_responses]: start
[lib/Redis/Fast.xs:177:wait_for_event]: select start, timeout is -1.000000
[lib/Redis/Fast.xs:182:wait_for_event]: select returns 1
[lib/Redis/Fast.xs:197:wait_for_event]: ready to write
[lib/Redis/Fast.xs:201:wait_for_event]: finish
[lib/Redis/Fast.xs:177:wait_for_event]: select start, timeout is -1.000000

##### HERE IT WAITS AGAIN for brpop to return something, but we send it signal 15 AGAIN

[lib/Redis/Fast.xs:182:wait_for_event]: select returns -1
[lib/Redis/Fast.xs:189:wait_for_event]: exception!!
[lib/Redis/Fast.xs:287:_wait_all_responses]: error: 2
[lib/Redis/Fast.xs:352:Redis__Fast_reconnect]: start
[lib/Redis/Fast.xs:360:Redis__Fast_reconnect]: finish
[lib/Redis/Fast.xs:609:Redis__Fast_run_cmd]: Finish BRPOP
TERM handler called at -e line 1.
[lib/Redis/Fast.xs:862:XS_Redis__Fast_DESTROY]: start
[lib/Redis/Fast.xs:864:XS_Redis__Fast_DESTROY]: free ac
[lib/Redis/Fast.xs:423:Redis__Fast_sync_reply_cb]: 0x16901b0
[lib/Redis/Fast.xs:431:Redis__Fast_sync_reply_cb]: redis feeing
[lib/Redis/Fast.xs:439:Redis__Fast_sync_reply_cb]: finish
[lib/Redis/Fast.xs:423:Redis__Fast_sync_reply_cb]: 0x16901b0
[lib/Redis/Fast.xs:431:Redis__Fast_sync_reply_cb]: redis feeing
*** glibc detected *** perl: double free or corruption (!prev): 0x00000000016901b0 ***
======= Backtrace: =========
/lib64/libc.so.6[0x381e876166]
/lib64/libc.so.6[0x381e878ca3]
/home/bj5004/perl5/lib/perl5/x86_64-linux-thread-multi/auto/Redis/Fast/Fast.so(+0xa0c5)[0x7f75bff0d0c5]
/home/bj5004/perl5/lib/perl5/x86_64-linux-thread-multi/auto/Redis/Fast/Fast.so(+0xed4d)[0x7f75bff11d4d]
/home/bj5004/perl5/lib/perl5/x86_64-linux-thread-multi/auto/Redis/Fast/Fast.so(+0x7a85)[0x7f75bff0aa85]
/usr/lib64/perl5/CORE/libperl.so(Perl_pp_entersub+0x5a5)[0x38322a6815]
/usr/lib64/perl5/CORE/libperl.so(Perl_call_sv+0x696)[0x383224c7a6]
/usr/lib64/perl5/CORE/libperl.so(Perl_sv_clear+0xb6)[0x38322b8dd6]
/usr/lib64/perl5/CORE/libperl.so(Perl_sv_free2+0x52)[0x38322b95d2]
/usr/lib64/perl5/CORE/libperl.so(Perl_leave_scope+0xe45)[0x38322d61f5]
/usr/lib64/perl5/CORE/libperl.so(Perl_pp_leave+0x105)[0x38322a6125]
/usr/lib64/perl5/CORE/libperl.so(Perl_runops_standard+0x16)[0x38322a4b06]
/usr/lib64/perl5/CORE/libperl.so(perl_run+0x338)[0x383224d0d8]
perl(main+0x154)[0x400e74]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x381e81ed1d]
perl[0x400c59]
======= Memory map: ========
00400000-00402000 r-xp 00000000 fd:00 282391                 /usr/bin/perl
00601000-00603000 rw-p 00001000 fd:00 282391                 /usr/bin/perl
01663000-01872000 rw-p 00000000 00:00 0                  [heap]
381e400000-381e420000 r-xp 00000000 fd:00 925185             /lib64/ld-2.12.so
381e61f000-381e620000 r--p 0001f000 fd:00 925185             /lib64/ld-2.12.so
381e620000-381e621000 rw-p 00020000 fd:00 925185             /lib64/ld-2.12.so
381e621000-381e622000 rw-p 00000000 00:00 0
381e800000-381e98b000 r-xp 00000000 fd:00 925188             /lib64/libc-2.12.so
381e98b000-381eb8a000 ---p 0018b000 fd:00 925188             /lib64/libc-2.12.so
381eb8a000-381eb8e000 r--p 0018a000 fd:00 925188             /lib64/libc-2.12.so
381eb8e000-381eb8f000 rw-p 0018e000 fd:00 925188             /lib64/libc-2.12.so
381eb8f000-381eb94000 rw-p 00000000 00:00 0
381ec00000-381ec17000 r-xp 00000000 fd:00 938218             /lib64/libpthread-2.12.so
381ec17000-381ee17000 ---p 00017000 fd:00 938218             /lib64/libpthread-2.12.so
381ee17000-381ee18000 r--p 00017000 fd:00 938218             /lib64/libpthread-2.12.so
381ee18000-381ee19000 rw-p 00018000 fd:00 938218             /lib64/libpthread-2.12.so
381ee19000-381ee1d000 rw-p 00000000 00:00 0
381f000000-381f002000 r-xp 00000000 fd:00 938224             /lib64/libdl-2.12.so
381f002000-381f202000 ---p 00002000 fd:00 938224             /lib64/libdl-2.12.so
381f202000-381f203000 r--p 00002000 fd:00 938224             /lib64/libdl-2.12.so
381f203000-381f204000 rw-p 00003000 fd:00 938224             /lib64/libdl-2.12.so
381f400000-381f483000 r-xp 00000000 fd:00 938221             /lib64/libm-2.12.so
381f483000-381f682000 ---p 00083000 fd:00 938221             /lib64/libm-2.12.so
381f682000-381f683000 r--p 00082000 fd:00 938221             /lib64/libm-2.12.so
381f683000-381f684000 rw-p 00083000 fd:00 938221             /lib64/libm-2.12.so
3820800000-3820816000 r-xp 00000000 fd:00 938228             /lib64/libresolv-2.12.so
3820816000-3820a16000 ---p 00016000 fd:00 938228             /lib64/libresolv-2.12.so
3820a16000-3820a17000 r--p 00016000 fd:00 938228             /lib64/libresolv-2.12.so
3820a17000-3820a18000 rw-p 00017000 fd:00 938228             /lib64/libresolv-2.12.so
3820a18000-3820a1a000 rw-p 00000000 00:00 0
3823c00000-3823c16000 r-xp 00000000 fd:00 938231             /lib64/libgcc_s-4.4.7-20120601.so.1
3823c16000-3823e15000 ---p 00016000 fd:00 938231             /lib64/libgcc_s-4.4.7-20120601.so.1
3823e15000-3823e16000 rw-p 00015000 fd:00 938231             /lib64/libgcc_s-4.4.7-20120601.so.1
3829400000-3829471000 r-xp 00000000 fd:00 938248             /lib64/libfreebl3.so
3829471000-3829670000 ---p 00071000 fd:00 938248             /lib64/libfreebl3.so
3829670000-3829672000 r--p 00070000 fd:00 938248             /lib64/libfreebl3.so
3829672000-3829673000 rw-p 00072000 fd:00 938248             /lib64/libfreebl3.so
3829673000-3829677000 rw-p 00000000 00:00 0
3829c00000-3829c07000 r-xp 00000000 fd:00 938249             /lib64/libcrypt-2.12.so
3829c07000-3829e07000 ---p 00007000 fd:00 938249             /lib64/libcrypt-2.12.so
3829e07000-3829e08000 r--p 00007000 fd:00 938249             /lib64/libcrypt-2.12.so
3829e08000-3829e09000 rw-p 00008000 fd:00 938249             /lib64/libcrypt-2.12.so
3829e09000-3829e37000 rw-p 00000000 00:00 0
382c800000-382c802000 r-xp 00000000 fd:00 938246             /lib64/libutil-2.12.so
382c802000-382ca01000 ---p 00002000 fd:00 938246             /lib64/libutil-2.12.so
382ca01000-382ca02000 r--p 00001000 fd:00 938246             /lib64/libutil-2.12.so
382ca02000-382ca03000 rw-p 00002000 fd:00 938246             /lib64/libutil-2.12.so
382e400000-382e416000 r-xp 00000000 fd:00 917625             /lib64/libnsl-2.12.so
382e416000-382e615000 ---p 00016000 fd:00 917625             /lib64/libnsl-2.12.so
382e615000-382e616000 r--p 00015000 fd:00 917625             /lib64/libnsl-2.12.so
382e616000-382e617000 rw-p 00016000 fd:00 917625             /lib64/libnsl-2.12.so
382e617000-382e619000 rw-p 00000000 00:00 0
3832200000-3832362000 r-xp 00000000 fd:00 278941             /usr/lib64/perl5/CORE/libperl.so
zsh: abort (core dumped)  perl -MRedis::Fast -E

Please make a release

Hello,

there are some commits in this repo since the 0.35 release more than half a year ago - would you please consider publishing a new release? Thanks!

-Yenya

Fix builds in osx

Currently, builds in osx are broken.

image

Here is raw log.

travis_time:end:236cd5cd:start=1500090834118673000,finish=1500090834413812000,duration=295139000
๏ฟฝ[0Ktravis_fold:end:before_install.5
๏ฟฝ[0Ktravis_fold:start:before_install.6
๏ฟฝ[0Ktravis_time:start:019dfe9e
๏ฟฝ[0K$ if [[ $TRAVIS_OS_NAME = osx ]]; then perlbrew list | xargs perlbrew uninstall --yes; fi

Deleting: /Users/travis/perl5/perlbrew/perls/5.26

Deleted:  /Users/travis/perl5/perlbrew/perls/5.26



travis_time:end:019dfe9e:start=1500090834430112000,finish=1500090834578314000,duration=148202000
๏ฟฝ[0Ktravis_fold:end:before_install.6
๏ฟฝ[0Ktravis_fold:start:before_install.7
๏ฟฝ[0Ktravis_time:start:1c451430
๏ฟฝ[0K$ source ~/travis-perl-helpers/init

/Users/travis/travis-perl-helpers/init: line 9: shell_session_update: command not found

Perl Travis Helpers: heads/master-0-gd2b2e22



travis_time:end:1c451430:start=1500090834595736000,finish=1500090834673909000,duration=78173000
๏ฟฝ[0Ktravis_fold:end:before_install.7
๏ฟฝ[0Ktravis_fold:start:before_install.8
๏ฟฝ[0Ktravis_time:start:1ffbb9f8
๏ฟฝ[0K$ if [[ $TRAVIS_OS_NAME = osx ]]; then export REBUILD_PERL=1; fi



travis_time:end:1ffbb9f8:start=1500090834686451000,finish=1500090834696748000,duration=10297000
๏ฟฝ[0Ktravis_fold:end:before_install.8
๏ฟฝ[0Ktravis_fold:start:before_install.9
๏ฟฝ[0Ktravis_time:start:05caba2a
๏ฟฝ[0K$ build-perl

Unable to find perl for 5.26!

"reconnect disabled inside transaction" is not working sometimes

use strict;
use warnings;
use Redis::Fast;
my $conn = Redis::Fast->new(
    reconnect     => 20,
    every         => 1000,
);
while(1){
  eval {
    $conn->multi;
    $conn->set("x" => 42);
    $conn->exec;
  1;
  } or do {
    print $@;
  }
}

If I restart Redis server during this script, it should print reconnect disabled inside transaction or watch time to time.

But, it also prints ERR EXEC without MULTI sometimes

reconnect disabled inside transaction or watch at /usr/local/lib/perl/5.14.2/Redis/Fast.pm line 178.
[exec] ERR EXEC without MULTI,  at /usr/local/lib/perl/5.14.2/Redis/Fast.pm line 179.
    Redis::Fast::__ANON__(Redis::Fast=SCALAR(0x2406670)) called at d.pl line 12
    eval {...} called at d.pl line 14

I think that could happen if you copypasted that logic: https://metacpan.org/source/DAMS/Redis-1.976/lib/Redis.pm#L227

first $self->{__inside_transaction} is disabled, and then command is processed. this is a bug.

(same for UNWATCH)

Add support for scan/sscan/hscan/zscan commands

I'm trying to use redis "scan" command. It works fine when I define cursor only:
$r->scan($Cursor);
but when I try to add some additional modifiers:
$r->scan('0 MATCH Foo.');
$r->scan("$Cursor MATCH "Foo."");
$r->scan("$Cursor COUNT 1000");
I receive error
[scan] ERR invalid cursor, at /usr/lib/perl5/Redis/Fast.pm line 101
Redis::Fast::ANON('Redis::Fast=SCALAR(0x21cbb98)', '0 MATCH Foo.*') called at ./1.pl line 14

It looks like incorrect type conversation error.

BTW, all of this calls works well via redis-cli client

BLPOP can timeout after successfully receive data

Redis::Fast 0.09

use strict;
use warnings;
use Redis::Fast;
my $redis = Redis::Fast->new(server => 'localhost:6379', reconnect=>1, cnx_timeout   => 0.2, read_timeout  => 1);
if (fork()) {
  sleep 2;
  $redis->rpush("somekey", 4);
  sleep 1;
  my $data = $redis->lpop("somekey");
  print "DATA $data\n";
}
else {
  $redis->blpop("somekey", 3);
  exit;
}
wait;
Use of uninitialized value $data in concatenation (.) or string at 1.pl line 10.
DATA 
Error while reading from Redis server: Connection timed out at /usr/local/lib/perl/5.14.2/Redis/Fast.pm line 178.

This means DATA is undef and that can happen only if child process already received data with BLPOP.

Not reproducible with Redis module:

use strict;
use warnings;
use Redis;
my $redis = Redis->new(server => 'localhost:6379', reconnect=>1, cnx_timeout   => 0.2, read_timeout  => 1);
if (fork()) {
  sleep 2;
  $redis->rpush("somekey", 4);
  sleep 1;
  my $data = $redis->lpop("somekey");
  print "DATA $data\n";
}
else {
  $redis->blpop("somekey", 3);
  exit;
}
wait;
Error while reading from Redis server: Resource temporarily unavailable at /usr/local/share/perl/5.14.2/Redis.pm line 267.
DATA 4

p.s.
also note different error message. I think users will have to parse error message cause if they wish to continue to work with redis after timeout happened, so would be good to have same error message for Redis and Redis::Fast

suboptimal CPU usage

On a multi CPU/Core system
Redis::Fast uses 65% of CPU1 and redis-server uses 35% of the same CPU.

Using other clients:
Client(Z) uses 100% of CPU(X) and redis-server uses 40% to 60% of CPU(Y)

Why does Redis::Fast use the same CPU core redis-server is using?

documentation for `select`

I see that the way to change between database indexes is with $client->select(<number>) -- could you please document this?

Also, is there a way to select the database index at connection time, or does it have to be done after connecting with select?

thanks!

Connect to localhost fails on 0.35

After the version bump and update of hiredis in 0.35 there is an issue where Redis::Fast is unable to connect to localhost:6379. On the other hand 127.0.0.1:6379 works without fail. This behaviour isn't seen on all hosts though. Example I used to reproduce this on one of the problematic hosts:

# Works fine, outputs nothing
perl -e 'use Redis::Fast; Redis::Fast->new(server => "127.0.0.1:6379")->keys("*");'

# Fails to connect, spits out error
perl -e 'use Redis::Fast; Redis::Fast->new(server => "localhost:6379")->keys("*");'
Could not connect to Redis server at localhost:6379 at [TRUNCATED].../local/lib/perl5/x86_64-linux/Redis/Fast.pm line 246.

On hosts where this is a problem version 0.34 works without failing, but version 0.35 fails on connect to localhost every time.

I don't quite know how to proceed in debugging this. What I have checked is that the system can resolve localhost just fine, and redis-cli also connects to the server just fine on both localhost and 127.0.0.1.

[email protected] ใงใƒ†ใ‚นใƒˆใŒใ‚ณใ‚ฑใ‚‹

macopy Redis::Fast Encode.pmใ‚’ๆœ€ๆ–ฐใซใ™ใ‚‹ใจt/01-basic.tใจ่จ€ใ†ใƒ†ใ‚นใƒˆใŒใ‚ณใ‚ฑใ‚‹ใฃใฝใ„ใงใ™ decode_utf8ใ—ใฆใ„ใ‚‹ใ‚„ใคใ‚’ๅค–ใ™ใจ็›ดใ‚‹
macopy [email protected]ใงใฎใ‚ตใƒžใƒชใƒผใงใ”ใ–ใ„ใพใ™ใ€‚ๅค–ใ—ใฆใ‚‚2.44_01ใงใฏใ‚ณใ‚ฑใชใ‹ใฃใŸใ“ใจใ‚‚ใ”ๅ ฑๅ‘Šใ•ใ›ใฆใ„ใŸใ ใใพใ™

t/01-basic.t ............. 1/? Cannot decode string with wide characters at /Users/taniwaki-makoto/.plenv/versions/5.16.3/lib/perl5/site_perl/5.16.3/darwin-2level/Encode.pm line 215.
# Tests were run but no plan was declared and done_testing() was not seen.
t/01-basic.t ............. Dubious, test returned 36 (wstat 9216, 0x2400)
All 13 subtests passed
ไปฅไธ‹็•ฅ

First connection use "every" instead of "cnx_timeout"

Hi,

The first connection use "every" params. By default it is set to "0.1ms" which make almost impossible to connect on a remote (though vpn) connection.
Even if the "cnx_timeout" is not set (mean no limit), it use the "every" params to try to reach the server.

I think the order should be :

first connection : cnx_timeout (if one set, or unlimit)

in case of disconnection with auto reconnect feature :
try to connect using the cnx_timeout
if fail, wait "every"
retry until we reach the "reconnect"

What do you think ?

sometimes blocks signals

problem in 0.06 and 0.05

use strict;
use warnings;
use POSIX;
use Redis::Fast;

my $redis = Redis::Fast->new(server => 'localhost:6379');

my @pids;
for (1..30){
  if (my $pid = fork() ) {
    push @pids, $pid;
    print STDERR "STARTED $$\n";
  } else {
    $SIG{INT}=sub{print STDERR "IGNORING INT\n";};
    $SIG{USR2}=sub{print STDERR "CHILD EXIT $$\n"; exit 0};
    while(){
        $redis->blpop("notakey", 10);
    # <>; 
    }
    exit;
  }
}
$SIG{INT}=sub{kill(POSIX::SIGUSR2, @pids)};
while(wait()!=-1){};
print "DONE\n";

to terminate this script I use Ctrl-C. Often (~ 20% cases) I need press Ctrl-C twice to terminate.

but if I replace $redis->blpop("notakey", 10); with <>; (i.e. readline from stdin), Ctrl-C works always. i.e. perl io works well with signals.

this code looks strange, but I reduced it from real code, which just tries to catch SIGUSR (and SIGINT just in case) and kill all child processes.

perl 5.14 from Ubuntu 12.04

also, sometimes segfaults

Attempt to free unreferenced scalar: SV 0x115f0c0, Perl interpreter: 0x113c010 during global destruction.
Attempt to free unreferenced scalar: SV 0x115f0c0, Perl interpreter: 0x113c010 during global destruction.
Attempt to free unreferenced scalar: SV 0x115f0c0, Perl interpreter: 0x113c010 during global destruction.

Reproducible in 0.05, 0.06, 0.08.
I tried 0.07 - don't installs. 0.08 - same + crash from issue #9 ), and btw 0.05 was before issue #5.

Tests fail with redis-server 4.0.11

Hello,
since Redis error messages have changed, t/04-pipeline.t fails. A little patch to be able to build with every redis version:

--- a/t/04-pipeline.t
+++ b/t/04-pipeline.t
@@ -36,7 +36,7 @@
 pipeline_ok 'single-command pipeline', ([set => [foo => 'bar'], 'OK'],);

 pipeline_ok 'pipeline with embedded error',
-  ([set => [clunk => 'eth'], 'OK'], [oops => [], undef, q[ERR unknown command 'OOPS']], [get => ['clunk'], 'eth'],);
+  ([set => [clunk => 'eth'], 'OK'], [get => ['clunk'], 'eth'],);

 pipeline_ok 'keys in pipelined mode',
   ([keys => ['*'], bag(qw<foo clunk>)], [keys => [], undef, q[ERR wrong number of arguments for 'keys' command]],);

does not play way with signals

using Redis::Fast 0.05

use strict;
use warnings;
use Redis::Fast;

my $redis = Redis::Fast->new(server => 'localhost:6379');
$redis->select(2);

{
    local $SIG{ALRM} = sub { die "ALARM\n"; };
    alarm 1;
    eval { $redis->blpop('abc', 20); };
    print $@;
}

prints

ALARM
Segmentation fault (core dumped)

or, sometimes code like this works without segfault, but alarm signal not delivered until BLPOP timeout expired (thus alarm is useless).

my perl (shipped with Ubuntu 12.04):

Summary of my perl5 (revision 5 version 14 subversion 2) configuration:

  Platform:
    osname=linux, osvers=2.6.42-37-generic, archname=x86_64-linux-gnu-thread-multi
    uname='linux batsu 2.6.42-37-generic #58-ubuntu smp thu jan 24 15:28:10 utc 2013 x86_64 x86_64 x86_64 gnulinux '
    config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=x86_64-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/perl/5.14 -Darchlib=/usr/lib/perl/5.14 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.14.2 -Dsitearch=/usr/local/lib/perl/5.14.2 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Duse64bitint -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -Ui_libutil -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -Dlibperl=libperl.so.5.14.2 -des'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -g',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.6.3', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib
    libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
    perllibs=-ldl -lm -lpthread -lc -lcrypt
    libc=, so=so, useshrplib=true, libperl=libperl.so.5.14.2
    gnulibc_version='2.15'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector'


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
                        PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT
                        USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF
                        USE_REENTRANT_API
  Locally applied patches:
    DEBPKG:debian/arm_thread_stress_timeout - http://bugs.debian.org/501970 Raise the timeout of ext/threads/shared/t/stress.t to accommodate slower build hosts
    DEBPKG:debian/cpan_definstalldirs - Provide a sensible INSTALLDIRS default for modules installed from CPAN.
    DEBPKG:debian/db_file_ver - http://bugs.debian.org/340047 Remove overly restrictive DB_File version check.
    DEBPKG:debian/doc_info - Replace generic man(1) instructions with Debian-specific information.
    DEBPKG:debian/enc2xs_inc - http://bugs.debian.org/290336 Tweak enc2xs to follow symlinks and ignore missing @INC directories.
    DEBPKG:debian/errno_ver - http://bugs.debian.org/343351 Remove Errno version check due to upgrade problems with long-running processes.
    DEBPKG:debian/libperl_embed_doc - http://bugs.debian.org/186778 Note that libperl-dev package is required for embedded linking
    DEBPKG:fixes/respect_umask - Respect umask during installation
    DEBPKG:debian/writable_site_dirs - Set umask approproately for site install directories
    DEBPKG:debian/extutils_set_libperl_path - EU:MM: Set location of libperl.a to /usr/lib
    DEBPKG:debian/no_packlist_perllocal - Don't install .packlist or perllocal.pod for perl or vendor
    DEBPKG:debian/prefix_changes - Fiddle with *PREFIX and variables written to the makefile
    DEBPKG:debian/fakeroot - Postpone LD_LIBRARY_PATH evaluation to the binary targets.
    DEBPKG:debian/instmodsh_doc - Debian policy doesn't install .packlist files for core or vendor.
    DEBPKG:debian/ld_run_path - Remove standard libs from LD_RUN_PATH as per Debian policy.
    DEBPKG:debian/libnet_config_path - Set location of libnet.cfg to /etc/perl/Net as /usr may not be writable.
    DEBPKG:debian/m68k_thread_stress - http://bugs.debian.org/517938 http://bugs.debian.org/495826 Disable some threads tests on m68k for now due to missing TLS.
    DEBPKG:debian/mod_paths - Tweak @INC ordering for Debian
    DEBPKG:debian/module_build_man_extensions - http://bugs.debian.org/479460 Adjust Module::Build manual page extensions for the Debian Perl policy
    DEBPKG:debian/prune_libs - http://bugs.debian.org/128355 Prune the list of libraries wanted to what we actually need.
    DEBPKG:fixes/net_smtp_docs - [rt.cpan.org #36038] http://bugs.debian.org/100195 Document the Net::SMTP 'Port' option
    DEBPKG:debian/perlivp - http://bugs.debian.org/510895 Make perlivp skip include directories in /usr/local
    DEBPKG:debian/disable-zlib-bundling - Disable zlib bundling in Compress::Raw::Zlib
    DEBPKG:debian/cpanplus_definstalldirs - http://bugs.debian.org/533707 Configure CPANPLUS to use the site directories by default.
    DEBPKG:debian/cpanplus_config_path - Save local versions of CPANPLUS::Config::System into /etc/perl.
    DEBPKG:debian/deprecate-with-apt - http://bugs.debian.org/580034 Point users to Debian packages of deprecated core modules
    DEBPKG:fixes/hurd-ccflags - [a190e64] http://bugs.debian.org/587901 [perl #92244] Make hints/gnu.sh append to $ccflags rather than overriding them
    DEBPKG:debian/squelch-locale-warnings - http://bugs.debian.org/508764 Squelch locale warnings in Debian package maintainer scripts
    DEBPKG:debian/skip-upstream-git-tests - Skip tests specific to the upstream Git repository
    DEBPKG:fixes/extutils-cbuilder-cflags - [011e8fb] http://bugs.debian.org/624460 [perl #89478] Append CFLAGS and LDFLAGS to their Config.pm counterparts in EU::CBuilder
    DEBPKG:fixes/module-build-home-directory - http://bugs.debian.org/624850 [rt.cpan.org #67893] Fix failing tilde test when run under a UID without a passwd entry
    DEBPKG:debian/patchlevel - http://bugs.debian.org/567489 List packaged patches for 5.14.2-6ubuntu2.3 in patchlevel.h
    DEBPKG:fixes/h2ph-multiarch - [e7ec705] http://bugs.debian.org/625808 [perl #90122] Make h2ph correctly search gcc include directories
    DEBPKG:fixes/index-tainting - [3b36395] http://bugs.debian.org/291450 [perl #64804] RT 64804: tainting with index() of a constant
    DEBPKG:debian/skip-kfreebsd-crash - http://bugs.debian.org/628493 [perl #96272] Skip a crashing test case in t/op/threads.t on GNU/kFreeBSD
    DEBPKG:fixes/document_makemaker_ccflags - http://bugs.debian.org/628522 [rt.cpan.org #68613] Document that CCFLAGS should include $Config{ccflags}
    DEBPKG:fixes/sys-syslog-socket-timeout-kfreebsd.patch - http://bugs.debian.org/627821 [rt.cpan.org #69997] Use a socket timeout on GNU/kFreeBSD to catch ICMP port unreachable messages
    DEBPKG:fixes/hurd-hints - http://bugs.debian.org/636609 Improve general GNU hints, needed for GNU/Hurd.
    DEBPKG:fixes/pod_fixes - [7698aed] http://bugs.debian.org/637816 Fix typos in several pod/perl*.pod files
    DEBPKG:debian/find_html2text - http://bugs.debian.org/640479 Configure CPAN::Distribution with correct name of html2text
    DEBPKG:fixes/digest_eval_hole - http://bugs.debian.org/644108 Close the eval "require $module" security hole in Digest->new($algorithm)
    DEBPKG:fixes/hurd-ndbm - [f0d0a20] [perl #102680] http://bugs.debian.org/645989 Add GNU/Hurd hints for NDBM_File
    DEBPKG:fixes/sysconf.t-posix - [8040185] [perl #102888] http://bugs.debian.org/646016 Fix hang in ext/POSIX/t/sysconf.t on GNU/Hurd
    DEBPKG:fixes/hurd-largefile - [1fda587] [perl #103014] http://bugs.debian.org/645790 enable LFS on GNU/Hurd
    DEBPKG:debian/hurd_test_todo_syslog - http://bugs.debian.org/650093 Disable failing GNU/Hurd tests in cpan/Sys-Syslog/t/syslog.t
    DEBPKG:fixes/hurd_skip_itimer_virtual - [rt.cpan.org #72754] http://bugs.debian.org/650094 Skip interval timer tests in Time::HiRes on GNU/Hurd
    DEBPKG:debian/hurd_test_skip_socketpair - http://bugs.debian.org/650186 Disable failing GNU/Hurd tests ext/Socket/t/socketpair.t
    DEBPKG:debian/hurd_test_skip_sigdispatch - http://bugs.debian.org/650188 Disable failing GNU/Hurd tests op/sigdispatch.t
    DEBPKG:debian/hurd_test_skip_stack - http://bugs.debian.org/650175 Disable failing GNU/Hurd tests dist/threads/t/stack.t
    DEBPKG:debian/hurd_test_skip_recv - http://bugs.debian.org/650095 Disable failing GNU/Hurd tests cpan/autodie/t/recv.t
    DEBPKG:debian/hurd_test_skip_libc - http://bugs.debian.org/650097 Disable failing GNU/Hurd tests dist/threads/t/libc.t
    DEBPKG:debian/hurd_test_skip_pipe - http://bugs.debian.org/650187 Disable failing GNU/Hurd tests io/pipe.t
    DEBPKG:debian/hurd_test_skip_io_pipe - http://bugs.debian.org/650096 Disable failing GNU/Hurd tests dist/IO/t/io_pipe.t
    DEBPKG:fixes/CVE-2012-5195 - avoid calling memset with a negative count
    DEBPKG:fixes/CVE-2012-5526 - [PATCH 1/4] CR escaping for P3P header
    DEBPKG:CVE-2013-1667.patch - [PATCH] Prevent premature hsplit() calls, and only trigger REHASH after hsplit()
  Built under linux
  Compiled at Mar 18 2013 19:17:55
  %ENV:
    PERLBREW_BASHRC_VERSION="0.67"
    PERLBREW_HOME="/home/vse/.perlbrew"
    PERLBREW_MANPATH=""
    PERLBREW_PATH="/home/perlbrew/bin"
    PERLBREW_ROOT="/home/perlbrew"
    PERLBREW_VERSION="0.67"
  @INC:
    /etc/perl
    /usr/local/lib/perl/5.14.2
    /usr/local/share/perl/5.14.2
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.14
    /usr/share/perl/5.14
    /usr/local/lib/site_perl
    .

similar code works fine in Redis module.

also, bug does not exists in perl 5.18.2

Summary of my perl5 (revision 5 version 18 subversion 2) configuration:

  Platform:
    osname=linux, osvers=3.8.0-35-generic, archname=x86_64-linux
    uname='linux green-u 3.8.0-35-generic #50~precise1-ubuntu smp wed dec 4 17:25:51 utc 2013 x86_64 x86_64 x86_64 gnulinux '
    config_args='-de -Dprefix=/home/perlbrew/perls/perl-5.18.2 -Aeval:scriptdir=/home/perlbrew/perls/perl-5.18.2/bin'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.6.3', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.15'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'


Characteristics of this binary (from libperl): 
  Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV
                        PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP
                        PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_ALL
                        USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE
                        USE_LOCALE_COLLATE USE_LOCALE_CTYPE
                        USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
  Built under linux
  Compiled at Jan  7 2014 17:47:24
  %ENV:
    PERL5LIB=""
    PERLBREW_BASHRC_VERSION="0.67"
    PERLBREW_HOME="/home/vse/.perlbrew"
    PERLBREW_MANPATH="/home/perlbrew/perls/perl-5.18.2/man"
    PERLBREW_PATH="/home/perlbrew/bin:/home/perlbrew/perls/perl-5.18.2/bin"
    PERLBREW_PERL="perl-5.18.2"
    PERLBREW_ROOT="/home/perlbrew"
    PERLBREW_VERSION="0.67"
  @INC:
    /home/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/x86_64-linux
    /home/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2
    /home/perlbrew/perls/perl-5.18.2/lib/5.18.2/x86_64-linux
    /home/perlbrew/perls/perl-5.18.2/lib/5.18.2
    .

Will not reconnect to redis service over a unix socket when the redis service is restarted

While doing a blpop if the redis service is restarted the Redis::Fast client will not reconnect.
However it will work if the client is killed from the redis-server.

Start your redis service listening to a unix socket

 redis-server --unixsocket /tmp/redis.sock

Run this in a separate session

my $redis = Redis::Fast->new(sock => '/tmp/redis.sock', reconnect => 60);

while(1) {
    my ($results) = $redis->blpop('bob',1);
    print $results // "undef","\n";
}

Killing the client is fine

redis-cli -s /tmp/redis.sock client list
redis-cli -s /tmp/redis.sock client kill /tmp/redis.sock:0
redis-cli -s /tmp/redis.sock client list

Restart the service the run the client list command

redis-cli -s /tmp/redis.sock client list

You will see that the client is not reconnecting or even throwing an error.
This does not happen when using tcp sockets.

0.08 crashes when BLPOP waits more than read_timeout

use strict;
use warnings;
use Redis::Fast;
my $redis = Redis::Fast->new(server => 'localhost:6379', reconnect=>1, cnx_timeout   => 0.2, read_timeout  => 0.3);
$redis->blpop("notakey", 1);
Error while reading from Redis server: Connection timed out at /usr/local/lib/perl/5.14.2/Redis/Fast.pm line 178.
*** glibc detected *** perl: double free or corruption (!prev): 0x000000000235d2b0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7f7bfd86fb96]
/usr/local/lib/perl/5.14.2/auto/Redis/Fast/Fast.so(+0xaf83)[0x7f7bfc43ff83]
/usr/local/lib/perl/5.14.2/auto/Redis/Fast/Fast.so(+0x403d)[0x7f7bfc43903d]
/usr/lib/libperl.so.5.14(Perl_pp_entersub+0x54f)[0x7f7bfdc6683f]
/usr/lib/libperl.so.5.14(Perl_call_sv+0x642)[0x7f7bfdbf97c2]
/usr/lib/libperl.so.5.14(Perl_sv_clear+0x580)[0x7f7bfdc6cbb0]
/usr/lib/libperl.so.5.14(Perl_sv_free2+0x52)[0x7f7bfdc6d2b2]
/usr/lib/libperl.so.5.14(Perl_leave_scope+0x12c8)[0x7f7bfdc95138]
/usr/lib/libperl.so.5.14(+0x47905)[0x7f7bfdbf8905]
/usr/lib/libperl.so.5.14(Perl_my_failure_exit+0x3a)[0x7f7bfdbff4ba]
/usr/lib/libperl.so.5.14(Perl_die_unwind+0x238)[0x7f7bfdc9d318]
/usr/lib/libperl.so.5.14(Perl_vcroak+0x39)[0x7f7bfdc416c9]
/usr/lib/libperl.so.5.14(+0x90234)[0x7f7bfdc41234]
/usr/local/lib/perl/5.14.2/auto/Redis/Fast/Fast.so(+0x93ae)[0x7f7bfc43e3ae]
/usr/local/lib/perl/5.14.2/auto/Redis/Fast/Fast.so(+0x9f56)[0x7f7bfc43ef56]
/usr/lib/libperl.so.5.14(Perl_pp_entersub+0x54f)[0x7f7bfdc6683f]
/usr/lib/libperl.so.5.14(Perl_runops_standard+0x16)[0x7f7bfdc5dcd6]
/usr/lib/libperl.so.5.14(perl_run+0x3aa)[0x7f7bfdbff39a]
perl(main+0x149)[0x400db9]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f7bfd81276d]
perl[0x400df1]
======= Memory map: ========
00400000-00402000 r-xp 00000000 08:12 786544                             /usr/bin/perl
00601000-00602000 r--p 00001000 08:12 786544                             /usr/bin/perl
00602000-00603000 rw-p 00002000 08:12 786544                             /usr/bin/perl
022f4000-024e4000 rw-p 00000000 00:00 0                                  [heap]
7f7bfb9fc000-7f7bfba11000 r-xp 00000000 08:12 1445757                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f7bfba11000-7f7bfbc10000 ---p 00015000 08:12 1445757                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f7bfbc10000-7f7bfbc11000 r--p 00014000 08:12 1445757                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f7bfbc11000-7f7bfbc12000 rw-p 00015000 08:12 1445757                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f7bfbc12000-7f7bfbc1e000 r-xp 00000000 08:12 1441997                    /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f7bfbc1e000-7f7bfbe1d000 ---p 0000c000 08:12 1441997                    /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f7bfbe1d000-7f7bfbe1e000 r--p 0000b000 08:12 1441997                    /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f7bfbe1e000-7f7bfbe1f000 rw-p 0000c000 08:12 1441997                    /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f7bfbe1f000-7f7bfbe28000 r-xp 00000000 08:12 3024691                    /usr/local/lib/perl/5.14.2/auto/List/Util/Util.so
7f7bfbe28000-7f7bfc027000 ---p 00009000 08:12 3024691                    /usr/local/lib/perl/5.14.2/auto/List/Util/Util.so
7f7bfc027000-7f7bfc028000 r--p 00008000 08:12 3024691                    /usr/local/lib/perl/5.14.2/auto/List/Util/Util.so
7f7bfc028000-7f7bfc029000 rw-p 00009000 08:12 3024691                    /usr/local/lib/perl/5.14.2/auto/List/Util/Util.so
7f7bfc029000-7f7bfc02b000 r-xp 00000000 08:12 2495823                    /usr/local/lib/perl/5.14.2/auto/Sub/Name/Name.so
7f7bfc02b000-7f7bfc22a000 ---p 00002000 08:12 2495823                    /usr/local/lib/perl/5.14.2/auto/Sub/Name/Name.so
7f7bfc22a000-7f7bfc22b000 r--p 00001000 08:12 2495823                    /usr/local/lib/perl/5.14.2/auto/Sub/Name/Name.so
7f7bfc22b000-7f7bfc22c000 rw-p 00002000 08:12 2495823                    /usr/local/lib/perl/5.14.2/auto/Sub/Name/Name.so
7f7bfc22c000-7f7bfc234000 r-xp 00000000 08:12 1446313                    /usr/local/lib/perl/5.14.2/auto/Encode/Encode.so
7f7bfc234000-7f7bfc433000 ---p 00008000 08:12 1446313                    /usr/local/lib/perl/5.14.2/auto/Encode/Encode.so
7f7bfc433000-7f7bfc434000 r--p 00007000 08:12 1446313                    /usr/local/lib/perl/5.14.2/auto/Encode/Encode.so
7f7bfc434000-7f7bfc435000 rw-p 00008000 08:12 1446313                    /usr/local/lib/perl/5.14.2/auto/Encode/Encode.so
7f7bfc435000-7f7bfc448000 r-xp 00000000 08:12 524465                     /usr/local/lib/perl/5.14.2/auto/Redis/Fast/Fast.so
7f7bfc448000-7f7bfc647000 ---p 00013000 08:12 524465                     /usr/local/lib/perl/5.14.2/auto/Redis/Fast/Fast.so
7f7bfc647000-7f7bfc648000 r--p 00012000 08:12 524465                     /usr/local/lib/perl/5.14.2/auto/Redis/Fast/Fast.so
7f7bfc648000-7f7bfc649000 rw-p 00013000 08:12 524465                     /usr/local/lib/perl/5.14.2/auto/Redis/Fast/Fast.so
7f7bfc649000-7f7bfce9b000 r--p 00000000 08:12 793391                     /usr/lib/locale/locale-archive
7f7bfce9b000-7f7bfcea4000 r-xp 00000000 08:12 1441994                    /lib/x86_64-linux-gnu/libcrypt-2.15.so
7f7bfcea4000-7f7bfd0a4000 ---p 00009000 08:12 1441994                    /lib/x86_64-linux-gnu/libcrypt-2.15.so
7f7bfd0a4000-7f7bfd0a5000 r--p 00009000 08:12 1441994                    /lib/x86_64-linux-gnu/libcrypt-2.15.so
7f7bfd0a5000-7f7bfd0a6000 rw-p 0000a000 08:12 1441994                    /lib/x86_64-linux-gnu/libcrypt-2.15.so
7f7bfd0a6000-7f7bfd0d4000 rw-p 00000000 00:00 0 
7f7bfd0d4000-7f7bfd0ec000 r-xp 00000000 08:12 1442002                    /lib/x86_64-linux-gnu/libpthread-2.15.so
7f7bfd0ec000-7f7bfd2eb000 ---p 00018000 08:12 1442002                    /lib/x86_64-linux-gnu/libpthread-2.15.so
7f7bfd2eb000-7f7bfd2ec000 r--p 00017000 08:12 1442002                    /lib/x86_64-linux-gnu/libpthread-2.15.so
7f7bfd2ec000-7f7bfd2ed000 rw-p 00018000 08:12 1442002                    /lib/x86_64-linux-gnu/libpthread-2.15.so
7f7bfd2ed000-7f7bfd2f1000 rw-p 00000000 00:00 0 
7f7bfd2f1000-7f7bfd3ec000 r-xp 00000000 08:12 1442004                    /lib/x86_64-linux-gnu/libm-2.15.so
7f7bfd3ec000-7f7bfd5eb000 ---p 000fb000 08:12 1442004                    /lib/x86_64-linux-gnu/libm-2.15.so
7f7bfd5eb000-7f7bfd5ec000 r--p 000fa000 08:12 1442004                    /lib/x86_64-linux-gnu/libm-2.15.so
7f7bfd5ec000-7f7bfd5ed000 rw-p 000fb000 08:12 1442004                    /lib/x86_64-linux-gnu/libm-2.15.so
7f7bfd5ed000-7f7bfd5ef000 r-xp 00000000 08:12 1442008                    /lib/x86_64-linux-gnu/libdl-2.15.so
7f7bfd5ef000-7f7bfd7ef000 ---p 00002000 08:12 1442008                    /lib/x86_64-linux-gnu/libdl-2.15.so
7f7bfd7ef000-7f7bfd7f0000 r--p 00002000 08:12 1442008                    /lib/x86_64-linux-gnu/libdl-2.15.so
7f7bfd7f0000-7f7bfd7f1000 rw-p 00003000 08:12 1442008                    /lib/x86_64-linux-gnu/libdl-2.15.so
7f7bfd7f1000-7f7bfd9a6000 r-xp 00000000 08:12 1441993                    /lib/x86_64-linux-gnu/libc-2.15.so
7f7bfd9a6000-7f7bfdba6000 ---p 001b5000 08:12 1441993                    /lib/x86_64-linux-gnu/libc-2.15.so
7f7bfdba6000-7f7bfdbaa000 r--p 001b5000 08:12 1441993                    /lib/x86_64-linux-gnu/libc-2.15.so
7f7bfdbaa000-7f7bfdbac000 rw-p 001b9000 08:12 1441993                    /lib/x86_64-linux-gnu/libc-2.15.so
7f7bfdbac000-7f7bfdbb1000 rw-p 00000000 00:00 0 
7f7bfdbb1000-7f7bfdd24000 r-xp 00000000 08:12 786448                     /usr/lib/libperl.so.5.14.2
7f7bfdd24000-7f7bfdf24000 ---p 00173000 08:12 786448                     /usr/lib/libperl.so.5.14.2
7f7bfdf24000-7f7bfdf28000 r--p 00173000 08:12 786448                     /usr/lib/libperl.so.5.14.2
7f7bfdf28000-7f7bfdf2d000 rw-p 00177000 08:12 786448                     /usr/lib/libperl.so.5.14.2
7f7bfdf2d000-7f7bfdf2e000 rw-p 00000000 00:00 0 
7f7bfdf2e000-7f7bfdf50000 r-xp 00000000 08:12 1442005                    /lib/x86_64-linux-gnu/ld-2.15.so
7f7bfe129000-7f7bfe12e000 rw-p 00000000 00:00 0 
7f7bfe14d000-7f7bfe150000 rw-p 00000000 00:00 0 
7f7bfe150000-7f7bfe151000 r--p 00022000 08:12 1442005                    /lib/x86_64-linux-gnu/ld-2.15.so
7f7bfe151000-7f7bfe153000 rw-p 00023000 08:12 1442005                    /lib/x86_64-linux-gnu/ld-2.15.so
7fff363e2000-7fff36403000 rw-p 00000000 00:00 0                          [stack]
7fff3654e000-7fff36550000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted (core dumped)

Summary of my perl5 (revision 5 version 14 subversion 2) configuration:

  Platform:
    osname=linux, osvers=2.6.42-37-generic, archname=x86_64-linux-gnu-thread-multi
    uname='linux panlong 2.6.42-37-generic #58-ubuntu smp thu jan 24 15:28:10 utc 2013 x86_64 x86_64 x86_64 gnulinux '
    config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=x86_64-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/perl/5.14 -Darchlib=/usr/lib/perl/5.14 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.14.2 -Dsitearch=/usr/local/lib/perl/5.14.2 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Duse64bitint -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -Ui_libutil -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -Dlibperl=libperl.so.5.14.2 -des'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -g',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.6.3', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib
    libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
    perllibs=-ldl -lm -lpthread -lc -lcrypt
    libc=, so=so, useshrplib=true, libperl=libperl.so.5.14.2
    gnulibc_version='2.15'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector'


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
                        PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT
                        USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF
                        USE_REENTRANT_API
  Locally applied patches:
    DEBPKG:debian/arm_thread_stress_timeout - http://bugs.debian.org/501970 Raise the timeout of ext/threads/shared/t/stress.t to accommodate slower build hosts
    DEBPKG:debian/cpan_definstalldirs - Provide a sensible INSTALLDIRS default for modules installed from CPAN.
    DEBPKG:debian/db_file_ver - http://bugs.debian.org/340047 Remove overly restrictive DB_File version check.
    DEBPKG:debian/doc_info - Replace generic man(1) instructions with Debian-specific information.
    DEBPKG:debian/enc2xs_inc - http://bugs.debian.org/290336 Tweak enc2xs to follow symlinks and ignore missing @INC directories.
    DEBPKG:debian/errno_ver - http://bugs.debian.org/343351 Remove Errno version check due to upgrade problems with long-running processes.
    DEBPKG:debian/libperl_embed_doc - http://bugs.debian.org/186778 Note that libperl-dev package is required for embedded linking
    DEBPKG:fixes/respect_umask - Respect umask during installation
    DEBPKG:debian/writable_site_dirs - Set umask approproately for site install directories
    DEBPKG:debian/extutils_set_libperl_path - EU:MM: Set location of libperl.a to /usr/lib
    DEBPKG:debian/no_packlist_perllocal - Don't install .packlist or perllocal.pod for perl or vendor
    DEBPKG:debian/prefix_changes - Fiddle with *PREFIX and variables written to the makefile
    DEBPKG:debian/fakeroot - Postpone LD_LIBRARY_PATH evaluation to the binary targets.
    DEBPKG:debian/instmodsh_doc - Debian policy doesn't install .packlist files for core or vendor.
    DEBPKG:debian/ld_run_path - Remove standard libs from LD_RUN_PATH as per Debian policy.
    DEBPKG:debian/libnet_config_path - Set location of libnet.cfg to /etc/perl/Net as /usr may not be writable.
    DEBPKG:debian/m68k_thread_stress - http://bugs.debian.org/517938 http://bugs.debian.org/495826 Disable some threads tests on m68k for now due to missing TLS.
    DEBPKG:debian/mod_paths - Tweak @INC ordering for Debian
    DEBPKG:debian/module_build_man_extensions - http://bugs.debian.org/479460 Adjust Module::Build manual page extensions for the Debian Perl policy
    DEBPKG:debian/prune_libs - http://bugs.debian.org/128355 Prune the list of libraries wanted to what we actually need.
    DEBPKG:fixes/net_smtp_docs - [rt.cpan.org #36038] http://bugs.debian.org/100195 Document the Net::SMTP 'Port' option
    DEBPKG:debian/perlivp - http://bugs.debian.org/510895 Make perlivp skip include directories in /usr/local
    DEBPKG:debian/disable-zlib-bundling - Disable zlib bundling in Compress::Raw::Zlib
    DEBPKG:debian/cpanplus_definstalldirs - http://bugs.debian.org/533707 Configure CPANPLUS to use the site directories by default.
    DEBPKG:debian/cpanplus_config_path - Save local versions of CPANPLUS::Config::System into /etc/perl.
    DEBPKG:debian/deprecate-with-apt - http://bugs.debian.org/580034 Point users to Debian packages of deprecated core modules
    DEBPKG:fixes/hurd-ccflags - [a190e64] http://bugs.debian.org/587901 [perl #92244] Make hints/gnu.sh append to $ccflags rather than overriding them
    DEBPKG:debian/squelch-locale-warnings - http://bugs.debian.org/508764 Squelch locale warnings in Debian package maintainer scripts
    DEBPKG:debian/skip-upstream-git-tests - Skip tests specific to the upstream Git repository
    DEBPKG:fixes/extutils-cbuilder-cflags - [011e8fb] http://bugs.debian.org/624460 [perl #89478] Append CFLAGS and LDFLAGS to their Config.pm counterparts in EU::CBuilder
    DEBPKG:fixes/module-build-home-directory - http://bugs.debian.org/624850 [rt.cpan.org #67893] Fix failing tilde test when run under a UID without a passwd entry
    DEBPKG:debian/patchlevel - http://bugs.debian.org/567489 List packaged patches for 5.14.2-6ubuntu2.4 in patchlevel.h
    DEBPKG:fixes/h2ph-multiarch - [e7ec705] http://bugs.debian.org/625808 [perl #90122] Make h2ph correctly search gcc include directories
    DEBPKG:fixes/index-tainting - [3b36395] http://bugs.debian.org/291450 [perl #64804] RT 64804: tainting with index() of a constant
    DEBPKG:debian/skip-kfreebsd-crash - http://bugs.debian.org/628493 [perl #96272] Skip a crashing test case in t/op/threads.t on GNU/kFreeBSD
    DEBPKG:fixes/document_makemaker_ccflags - http://bugs.debian.org/628522 [rt.cpan.org #68613] Document that CCFLAGS should include $Config{ccflags}
    DEBPKG:fixes/sys-syslog-socket-timeout-kfreebsd.patch - http://bugs.debian.org/627821 [rt.cpan.org #69997] Use a socket timeout on GNU/kFreeBSD to catch ICMP port unreachable messages
    DEBPKG:fixes/hurd-hints - http://bugs.debian.org/636609 Improve general GNU hints, needed for GNU/Hurd.
    DEBPKG:fixes/pod_fixes - [7698aed] http://bugs.debian.org/637816 Fix typos in several pod/perl*.pod files
    DEBPKG:debian/find_html2text - http://bugs.debian.org/640479 Configure CPAN::Distribution with correct name of html2text
    DEBPKG:fixes/digest_eval_hole - http://bugs.debian.org/644108 Close the eval "require $module" security hole in Digest->new($algorithm)
    DEBPKG:fixes/hurd-ndbm - [f0d0a20] [perl #102680] http://bugs.debian.org/645989 Add GNU/Hurd hints for NDBM_File
    DEBPKG:fixes/sysconf.t-posix - [8040185] [perl #102888] http://bugs.debian.org/646016 Fix hang in ext/POSIX/t/sysconf.t on GNU/Hurd
    DEBPKG:fixes/hurd-largefile - [1fda587] [perl #103014] http://bugs.debian.org/645790 enable LFS on GNU/Hurd
    DEBPKG:debian/hurd_test_todo_syslog - http://bugs.debian.org/650093 Disable failing GNU/Hurd tests in cpan/Sys-Syslog/t/syslog.t
    DEBPKG:fixes/hurd_skip_itimer_virtual - [rt.cpan.org #72754] http://bugs.debian.org/650094 Skip interval timer tests in Time::HiRes on GNU/Hurd
    DEBPKG:debian/hurd_test_skip_socketpair - http://bugs.debian.org/650186 Disable failing GNU/Hurd tests ext/Socket/t/socketpair.t
    DEBPKG:debian/hurd_test_skip_sigdispatch - http://bugs.debian.org/650188 Disable failing GNU/Hurd tests op/sigdispatch.t
    DEBPKG:debian/hurd_test_skip_stack - http://bugs.debian.org/650175 Disable failing GNU/Hurd tests dist/threads/t/stack.t
    DEBPKG:debian/hurd_test_skip_recv - http://bugs.debian.org/650095 Disable failing GNU/Hurd tests cpan/autodie/t/recv.t
    DEBPKG:debian/hurd_test_skip_libc - http://bugs.debian.org/650097 Disable failing GNU/Hurd tests dist/threads/t/libc.t
    DEBPKG:debian/hurd_test_skip_pipe - http://bugs.debian.org/650187 Disable failing GNU/Hurd tests io/pipe.t
    DEBPKG:debian/hurd_test_skip_io_pipe - http://bugs.debian.org/650096 Disable failing GNU/Hurd tests dist/IO/t/io_pipe.t
    DEBPKG:fixes/CVE-2012-5195 - avoid calling memset with a negative count
    DEBPKG:fixes/CVE-2012-5526 - [PATCH 1/4] CR escaping for P3P header
    DEBPKG:CVE-2013-1667.patch - [PATCH] Prevent premature hsplit() calls, and only trigger REHASH after hsplit()
    DEBPKG:CVE-2012-6329.patch - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=695224 [1735f6f] fix arbitrary command execution via _compile function in Maketext.pm
  Built under linux
  Compiled at Feb  4 2014 23:11:19
  %ENV:
    PERLBREW_BASHRC_VERSION="0.67"
    PERLBREW_HOME="/home/vse/.perlbrew"
    PERLBREW_MANPATH=""
    PERLBREW_PATH="/home/perlbrew/bin"
    PERLBREW_ROOT="/home/perlbrew"
    PERLBREW_VERSION="0.67"
  @INC:
    /etc/perl
    /usr/local/lib/perl/5.14.2
    /usr/local/share/perl/5.14.2
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.14
    /usr/share/perl/5.14
    /usr/local/lib/site_perl
    .

reproduced on two servers. and it seems that 0.05 works fine. we rolled back and all fine now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.