ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roman Shtykh (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-1423) Zero expiry policy does not work sometimes
Date Fri, 18 Sep 2015 11:28:04 GMT

    [ https://issues.apache.org/jira/browse/IGNITE-1423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14847277#comment-14847277
] 

Roman Shtykh commented on IGNITE-1423:
--------------------------------------

I apologize, I forgot about getExpiryForAccess

> Zero expiry policy does not work sometimes
> ------------------------------------------
>
>                 Key: IGNITE-1423
>                 URL: https://issues.apache.org/jira/browse/IGNITE-1423
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache
>    Affects Versions: 1.1.4
>            Reporter: Pavel  Tupitsyn
>             Fix For: ignite-1.5
>
>
> Paste the following test to GridCacheReplicatedMultiNodeFullApiSelfTest.java and run.
> Last assertion fails. Cycle is necessary because it does not always fail.
> {code:title=GridCacheReplicatedMultiNodeFullApiSelfTest.java}
>     public void testExpiredBug() throws Exception {
>         final ExpiryPolicy plc = new ExpiryPolicy() {
>             @Override public Duration getExpiryForCreation() {
>                 return Duration.ZERO;
>             }
>             @Override public Duration getExpiryForAccess() {
>                 return Duration.ZERO;
>             }
>             @Override public Duration getExpiryForUpdate() {
>                 return Duration.ZERO;
>             }
>         };
>         IgniteCache c1 = ignite(0).cache(null);
>         IgniteCache c2 = ignite(1).cache(null);
>         String key0 = primaryKeysForCache(c1, 1).get(0);
>         String key1 = primaryKeysForCache(c2, 1).get(0);
>         IgniteCache cache0 = c1;
>         IgniteCache cache = c1.withExpiryPolicy(plc);
>         for (int i = 0; i < 3000; i++) {
>             cache.put(key0, key0);
>             cache.put(key1, key1);
>             assert !cache0.containsKey(key0);
>             assert !cache0.containsKey(key1);
>             cache0.put(key0, key0);
>             cache0.put(key1, key1);
>             assert cache0.containsKey(key0);
>             assert cache0.containsKey(key1);
>             cache.put(key0, key0 + 1);
>             cache.put(key1, key1 + 1);
>             assert !cache0.containsKey(key0);
>             assert !cache0.containsKey(key1);
>             cache0.put(key0, key0);
>             cache0.put(key1, key1);
>             cache.get(key0);
>             cache.get(key1);
>             assert !cache0.containsKey(key0);
>             assert !cache0.containsKey(key1);
>         }
>     }}
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message