lishunli / xmemcached

Automatically exported from code.google.com/p/xmemcached
Apache License 2.0
0 stars 0 forks source link

negative exp results in errors #138

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
using cas in ascii mode results in errors when exp is negative. Why use a 
negative expiration? To implement a compare and delete using cas.

against a real memcached server, it throws the following exception: 
net.rubyeye.xmemcached.exception.UnknownCommandException: Response error,error 
message:Unknow command CAS

against jmemcache-daemon, it results in a timeout:
java.util.concurrent.TimeoutException: Timed out(2000) waiting for operation

behaves as expected in binary mode; however, later versions of memcached have 
changed the their behavior with respect to negative expiration values. prior 
versions treated a negative expiration in a set / cas as a delete. newest 
version sets it with an unknown expiration (possibily infinite). 

workaround for xmemcached (and newer releases of memcached) is to use an 
expiration of 2592001 (30 days + 1 second).

Original issue reported on code.google.com by jonat...@gmail.com on 13 Jul 2011 at 9:41

GoogleCodeExporter commented 9 years ago
Thanks,i will check it with newer releases of memcached.

Original comment by killme2...@gmail.com on 14 Jul 2011 at 2:23