Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-2862

shutdown hook does not wait for disk store async tasks to complete

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.0.0-incubating
    • None
    • persistence

    Description

      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:

            // don't block the shutdown hook
            if (Thread.currentThread() != InternalDistributedSystem.shutdownHook) {
              waitForBackgroundTasks();
            }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            dschneider Darrel Schneider
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: