{"action":"created","issue":{"url":"https://api.github.com/repos/mrniko/redisson/issues/481","repository_url":"https://api.github.com/repos/mrniko/redisson","labels_url":"https://api.github.com/repos/mrniko/redisson/issues/481/labels{/name}","comments_url":"https://api.github.com/repos/mrniko/redisson/issues/481/comments","events_url":"https://api.github.com/repos/mrniko/redisson/issues/481/events","html_url":"https://github.com/mrniko/redisson/issues/481","id":151166038,"number":481,"title":"RSetCache TTL doesnt readd after expiry via RSetCache.add","user":{"login":"neilwightman","id":731426,"avatar_url":"https://avatars.githubusercontent.com/u/731426?v=3","gravatar_id":"","url":"https://api.github.com/users/neilwightman","html_url":"https://github.com/neilwightman","followers_url":"https://api.github.com/users/neilwightman/followers","following_url":"https://api.github.com/users/neilwightman/following{/other_user}","gists_url":"https://api.github.com/users/neilwightman/gists{/gist_id}","starred_url":"https://api.github.com/users/neilwightman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neilwightman/subscriptions","organizations_url":"https://api.github.com/users/neilwightman/orgs","repos_url":"https://api.github.com/users/neilwightman/repos","events_url":"https://api.github.com/users/neilwightman/events{/privacy}","received_events_url":"https://api.github.com/users/neilwightman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-26T15:29:44Z","updated_at":"2016-04-26T17:11:44Z","closed_at":null,"body":"I have a problem with a RSetCache with TTL.   The problem seems to be that the value is not returned from the iterator and calling readAll throws an exception.\r\n\r\nRedisson : 2.2.12\r\nRedis : 3.0.7 (00000000/0) 64 bit\r\n\r\nI have attached a test which reproduces the issue.\r\n\r\n[RSetCacheTest.java.txt](https://github.com/mrniko/redisson/files/236919/RSetCacheTest.java.txt)\r\n\r\nWhen I run this, it keeps adding a string into the set and it should expire but be replaced quickly, this doesn't happen and the set is empty after the 30 seconds.\r\n\r\nCalling readAll() on the set it fails with the following error.\r\n\r\nERR Error running script (call to f_288eac369e58accf826304d109d8a5d7ac3e8343): @user_script:1: @user_script: 1: Wrong number of args calling Redis command From Lua script . channel: [id: 0x9894758e, L:/127.0.0.1:54251 - R:localhost/127.0.0.1:6379] command: CommandData [promise=ImmediateEventExecutor$ImmediatePromise@1e313298(incomplete), command=(EVAL), params=[local expireHead = redis.call('zrange', KEYS[2], 0, 0, 'withscores');local keys = redis.call('hkeys', KEYS[1]); if #keys == 0 then return {}; end; local maxDate = ARGV[1]; local minExpireDate = 92233720368547758;if #expireHead == 2 and tonumber(expireHead[2]) <= tonumber(maxDate) then for i = #keys, 1, -1 do local key = keys[i]; local expireDate = redis.call('zscore', KEYS[2], key); if expireDate ~= false and tonumber(expireDate) <= tonumber(maxDate) then minExpireDate = math.min(tonumber(expireDate), minExpireDate); table.remove(keys, i); end;end;end; return redis.call('hmget', KEYS[1], unpack(keys));, 2, testRSetCacheTTL, redisson__timeout__set__{testRSetCacheTTL}, 1461683799524], codec=org.redisson.codec.JsonJacksonCodec@2ff0a8a4]\r\n\r\nUsing : \r\n> hscan testRSetCacheTTL 0\r\n\r\nshows the value in the set while its running and after (when I disable the delete() call).\r\n\r\nAlso note that removing the delete() call seems to stop the exception from readAll().  So using readAll() with no delete() works or using delete() without the readAll().   But I have a feeling that it could be timing related."},"comment":{"url":"https://api.github.com/repos/mrniko/redisson/issues/comments/214814797","html_url":"https://github.com/mrniko/redisson/issues/481#issuecomment-214814797","issue_url":"https://api.github.com/repos/mrniko/redisson/issues/481","id":214814797,"user":{"login":"neilwightman","id":731426,"avatar_url":"https://avatars.githubusercontent.com/u/731426?v=3","gravatar_id":"","url":"https://api.github.com/users/neilwightman","html_url":"https://github.com/neilwightman","followers_url":"https://api.github.com/users/neilwightman/followers","following_url":"https://api.github.com/users/neilwightman/following{/other_user}","gists_url":"https://api.github.com/users/neilwightman/gists{/gist_id}","starred_url":"https://api.github.com/users/neilwightman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neilwightman/subscriptions","organizations_url":"https://api.github.com/users/neilwightman/orgs","repos_url":"https://api.github.com/users/neilwightman/repos","events_url":"https://api.github.com/users/neilwightman/events{/privacy}","received_events_url":"https://api.github.com/users/neilwightman/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T17:11:44Z","updated_at":"2016-04-26T17:11:44Z","body":"Correct, but after 30 seconds its expired so no longer in the set, so shouldn't it get set again?"}}