Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix connecting through sentinels (#78)
Fix for #76 : When connecting to sentinels and sending get-master-addr-by-name query, the Mojo::Promise object should be bound to the Mojo::Redis' own ioloop, otherwise it is not fulfilled and the ->then() callback is not called. Despite originally reported as authentication problem in #76, sentinel connection does not work at all, even when no authentication is set up. A minimal test case: $ cat redis.conf port 7000 $ cat sentinel.conf port 7001 sentinel monitor mymaster 127.0.0.1 7000 1 sentinel down-after-milliseconds mymaster 60000 $ redis-server ./redis.conf & $ redis-sentinel ./sentinel.conf & $ perl -MRedis -E 'my $r = Redis->new(service=>"mymaster", sentinels=>["127.0.0.1:7001"]); $r->set("/test" => 42, EX => 100); say $r->get("/test")' 42 $ MOJO_REDIS_DEBUG=1 perl -MMojo::Redis -E 'my $r = Mojo::Redis->new("redis://mymaster?sentinel=127.0.0.1:7001"); $r->db->set("/test" => 42); say $r->db->get("/test");'
- Loading branch information