ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Magda (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-3513) Cleanup worker is placed in the Thread's waiting queue using Thread.sleep method
Date Wed, 20 Jul 2016 12:10:20 GMT

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

Denis Magda commented on IGNITE-3513:
-------------------------------------

[~agura], imagine the case when you placed two entries in the cache with TTLs as in the description
and that you're waiting for EXPIRED events. If there are no cache updates happen during a
minute (TTL of the second placed entry) then you won't get EXPIRED event in time. This should
be fixed.

> Cleanup worker is placed in the Thread's waiting queue using Thread.sleep method
> --------------------------------------------------------------------------------
>
>                 Key: IGNITE-3513
>                 URL: https://issues.apache.org/jira/browse/IGNITE-3513
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 1.6
>            Reporter: Denis Magda
>            Assignee: Andrey Gura
>             Fix For: 1.7
>
>
> There is a bug in current implementation of {{GridCacheTtlManager#CleanupWorker}}.
> Refer to the implementation's code snippet and the details below.
> {code}
> EntryWrapper first = pendingEntries.firstx();
>  if (first != null) {
>    long waitTime = first.expireTime - U.currentTimeMillis();
>    if (waitTime > 0)
>       U.sleep(waitTime);
>  }
> {code}
> 1. Put first item with TTL = 1 hour. CleanupWorker will go to sleep for 1 hour.
> 2. Put second item with TTL = 1 minute. Since 
> CleanupWorker's thread sleeps now, second item will not be expired at the time.
> NOTE: This scenario is easily to reproducible if first and second items are put into
cache asynchronously. If try to put them in same thread one-by-one expiration may work fine.



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

Mime
View raw message