Description
Team, got a customer saying that the CAS operation within spy 2.7.3 doesn't seem to reset the expiration of a key properly.
Here's a snippet of code:
public String updateVsSession(String key, final String session) throws Exception {
MemcachedClient sessionClient = cachePool.getConnection(PersistableBeanType.VS_SESSION);
Transcoder tc = new SerializingTranscoder();
CASMutator<String> mutator = new CASMutator<String>(sessionClient, tc);
CASMutation<String> mutation = new CASMutation<String>() {
public String getNewValue(String current)
{ return session; }};
return mutator.cas(key, session, 1900, mutation);
}
It appears that when running the CAS operation only once, the key expires as expected. However, if an update is made and the operation is run again, the key seems to last forever.
Can you confirm whether this is a bug or expected? The customer expects that the CAS operation would constantly "extend" the expiration time.