Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-3513

Cleanup worker is placed in the Thread's waiting queue using Thread.sleep method

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6
    • 1.7
    • None
    • None

    Description

      There is a bug in current implementation of GridCacheTtlManager#CleanupWorker.

      Refer to the implementation's code snippet and the details below.

      EntryWrapper first = pendingEntries.firstx();
      
       if (first != null) {
         long waitTime = first.expireTime - U.currentTimeMillis();
      
         if (waitTime > 0)
            U.sleep(waitTime);
       }
      

      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.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            sboikov Semen Boikov
            dmagda Denis A. Magda
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment