Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash: LOADING Redis is loading the dataset in memory #19

Open
vsespb opened this issue Aug 7, 2014 · 1 comment
Open

Crash: LOADING Redis is loading the dataset in memory #19

vsespb opened this issue Aug 7, 2014 · 1 comment

Comments

@vsespb
Copy link
Contributor

vsespb commented Aug 7, 2014

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.

@shogo82148
Copy link
Owner

Thank you for your report.
I implemented wait_until_loaded option. ( #23 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants