JSD does not shut down gracefully and is forcefully killed

XMLWordPrintable

    • 2
    • Severity 3 - Minor
    • 37

      Issue Summary

      This is reproducible on Data Center: (yes) / (no)

      Steps to Reproduce

      1. Install a JIRA+JSM or only JSD
      2. Attempt to Stop it via stop-jira.sh script under $JIRA_INSTALL\bin
      3. The issue still persists even after increasing the timeout by editing $JIRA_INST/bin/stop-jira.sh and modify the shutdown timeout on following two lines to 300.
      exec $PRGDIR/shutdown.sh 100 -force $@
      $sucmd -m $JIRA_USER -c "$PRGDIR/shutdown.sh 100 -force $@"

      Expected Results

      • JIRA/JSD should stop gracefully and should not be killed after timeout mentioned in stop-jira.hs

      Actual Results

      Jira is killed forcefully with below logging on the console, 

      Tomcat did not stop in time.
      To aid diagnostics a thread dump has been written to standard out.
      Killing Tomcat with the PID: 12726
      The Tomcat process has been killed. 

      Workaround

      None

      Additional details

      One of the NON-DAEMON thread mentioned below is seen throughout the thread-dump after the main thread exits. The thread seems blocking the graceful shutdown of JIRA. 

      "pool-33-thread-1" #547 prio=5 os_prio=31 tid=0x00007f79179e4000 nid=0x15b07 waiting on condition [0x000000030cb37000]
         java.lang.Thread.State: WAITING (parking)
          at sun.misc.Unsafe.park(Native Method)
          - parking to wait for  <0x000000074e4758f8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
          at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
          at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
          at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1081)
          at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
          at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)  

      If Jira terminated while shutting down but is actually doing some useful operation, there may be a risk that operation is terminated half way through causing data loss or corruption. Also, it will delay the shutdown time as the script will always wait for the timeout value to be reached before existing.

            Assignee:
            Tripta Kaur
            Reporter:
            Sandip Shrivastava
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: