Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Redis CPAN distribution.

Report information
The Basics
Id: 64472
Status: resolved
Priority: 0/
Queue: Redis

People
Owner: melo [...] cpan.org
Requestors: brian [...] omniti.com
Cc:
AdminCc:

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



Subject: Quit does not clear socket internally
Date: Tue, 4 Jan 2011 15:58:05 -0500
To: bug-redis [...] rt.cpan.org
From: Brian Dunavant <brian [...] omniti.com>
$r->quit closes the socket but does not track that it has done so internally. Example (assume I have a key named "blah" with value "0"). ; perl -MRedis -e '$r = Redis->new(); print "".$r->get("blah")."\n"; $r->quit; $r->quit; ' 0 print() on closed filehandle GEN0 at /opt/OMNIperl/lib/site_perl/5.8.8/Redis.pm line 113. can't close socket: Bad file number at /opt/OMNIperl/lib/site_perl/5.8.8/Redis.pm line 116. This can be addressed with a one line change inside of the AUTOLOAD function. Change the following code at line 115: if ( $command eq 'quit' ) { close( $sock ) || die "can't close socket: $!"; return 1; } to: if ( $command eq 'quit' ) { close( $sock ) || die "can't close socket: $!"; undef $self->{sock}; return 1; } This causes it to fail with the more correct error (using my BrianRedis.pm which has the change): ; perl -MBrianRedis -e '$r = BrianRedis->new(); print "".$r->get("blah")."\n"; $r->quit; $r->quit; ' 0 no server connected at /home/brian/BrianRedis.pm line 80. Thanks, Brian Dunavant
Partially fixed in 1.901, should be totally fixed in 1.902 later today. Thanks,
Fixed in https://github.com/melo/perl- redis/commit/adcbbb6a75cd69b30f3a8fe1d1b14c298e572cac Release today or maybe tomorrow morning. Thanks! -- Hi, how are you?