Skip Menu |

This queue is for tickets about the Cache-Memcached CPAN distribution.

Report information
The Basics
Id: 54543
Status: new
Priority: 0/
Queue: Cache-Memcached

People
Owner: Nobody in particular
Requestors: MANWAR [...] cpan.org
Cc: mohammad.anwar [...] yahoo.com
AdminCc:

Bug Information
Severity: Important
Broken in: 1.24
Fixed in: (no value)



CC: mohammad.anwar [...] yahoo.com
Subject: Silently ignores if it can't open the connection to the memcached server
Hi, I have come across very annoying bug in Cache::Memcached module where it doesn't shout when it can't reach the memcached server. User happily thinks all is good where in reality it is not. I have attached the test script that I used for testing. I tried calling mehod sock_to_host() to check if we actually have any socket or not. That does tell me whether the server is up or down. It would have been nice if this was checked in the constructor i.e. new() and carp() if it can't reach memcached server. I take this opportunity to Thank you for such a lovely interface. Best Regards, Mohammad Sajid Anwar London
Subject: test-memcached-server.pl
#!/usr/bin/perl use strict; use warnings; use Cache::Memcached; my $memcached = Cache::Memcached->new({servers=>['127.0.0.1:11211'], debug => 1}); die "Unable to connect: $!\n" unless defined $memcached; print "Connected? [Untrusted information]\n"; my $socket = $memcached->sock_to_host('127.0.0.1:11211'); print "No socket, server is actually down.\n" unless defined $socket; print "You can be sure that server is up and running.\n";