You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by "Darrel Schneider (JIRA)" <ji...@apache.org> on 2017/05/02 18:47:04 UTC

[jira] [Created] (GEODE-2862) shutdown hook does not wait for disk store async tasks to complete

Darrel Schneider created GEODE-2862:
---------------------------------------

             Summary: shutdown hook does not wait for disk store async tasks to complete
                 Key: GEODE-2862
                 URL: https://issues.apache.org/jira/browse/GEODE-2862
             Project: Geode
          Issue Type: Bug
          Components: persistence
            Reporter: Darrel Schneider


If you do a normal cache close and are using persistence then each disk store close will wait for all of its async background tasks to complete.
But if instead the JVM shutdown hook is used (see java.lang.Runtime.addShutdownHook(Thread) for a description of what causes the shutdown hook to be called) then it will not wait for the async persistent tasks to complete.

Both of these types of shutdown are considered an orderly shutdown (as opposed to a unorderly shutdown caused by things like a kill -9) and geode should only have one type of orderly shutdown. By not waiting for the async persistent tasks to complete some files may never be fully written.

Here is the code that causes the shutdown hook to not wait in DiskStoreImpl:
{code}
      // don't block the shutdown hook
      if (Thread.currentThread() != InternalDistributedSystem.shutdownHook) {
        waitForBackgroundTasks();
      }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)