[Redis] Redis client: Timeouts !

Celogeek San me at celogeek.com
Fri Dec 27 11:47:46 GMT 2013


Ok perfect. I will remove the alarm stuff, and try this version Monday.
I will report if anything go nice and test a heavy drop packet on a Linux
box.
Thanks dams
Le 27 d=E9c. 2013 12:23, "Damien Krotkine" <dkrotkine at gmail.com> a =E9crit :

>
>
>
>
> Le 27 d=E9c. 2013 =E0 08:40, Celogeek San <me at celogeek.com> a =E9crit :
>
> Hi. What happen in case of read timeout?
> Did you close the connexion?
>
> If I read a data with a very long time to response.
> So I have a read time out.
> And then I do another command.
> It is possible if the socket had not been flush to receive the precedent
> command
>
> Yes indeed. Contrary to a previous implementation ( where the socket was
> closed for you), this implementation doesn't do anything for you on the
> socket. When a timeout is hit, Redis.pm throws an exception and $! Is set.
> You should then close the connection and retry.
>
> In theory, if the timeout was hit while writing, you could retry with the
> same socket, because you can be reasonably  site that the command didn't
> hit the server. However, I don't think Redis exceptions will make it clear
> if it was while reading or writing. There is a ticket on github to
> implement better exceptions.
>
>
> Le 26 d=E9c. 2013 23:28, "Damien Krotkine" <damien at krotkine.com> a =E9cri=
t :
>
>> Hi,
>>
>> I've just pushed new code in the git master branch. It contains timeouts
>> related features. Now you can creates a Redis client with connection,
>> read and write timeouts:
>>
>> my $redis =3D Redis->new(
>>     cnx_timeout =3D> 60,      # connection timeout (in seconds)
>>     read_timeout =3D> 0,5,    # read timeout (in seconds)
>>     write_timeout =3D> 1.2,    # write timeout (in seconds)
>> );
>>
>> I haven't yet released it on CPAN, I'd like to do a developer release
>> first (but I'm not sure how to do that with dzil). Anyway please feel
>> free to test it and let me know of any issues. The code uses 2
>> strategies, on mac and linux it uses setsockopt to set read / write
>> timeouts, on other OS it uses 'select'. I plan to extend the setsockopt
>> strategies to more OS.
>>
>> dams.
>>
>>
>> _______________________________________________
>> Redis mailing list
>> Redis at lists.scsys.co.uk
>> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/redis
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/redis/attachments/20131227/0e757742=
/attachment.htm


More information about the Redis mailing list