4 Replies Latest reply on Oct 2, 2012 3:44 PM by rhauch

    Shutdown issue

    kurtstam

      I'm call shutdown when tomcat is going down, but one ModeShape thread is in wait and will not release:

       

      "modeshape-cron-2-thread-1" prio=5 tid=7ff3201cd800 nid=0x10f201000 waiting on condition [10f200000]

         java.lang.Thread.State: TIMED_WAITING (parking)

              at sun.misc.Unsafe.park(Native Method)

              - parking to wait for  <7f535ff80> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)

              at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:196)

              at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025)

              at java.util.concurrent.DelayQueue.take(DelayQueue.java:164)

              at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:609)

              at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:602)

              at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

              at java.lang.Thread.run(Thread.java:680)

       

      which sounds like https://issues.jboss.org/browse/MODE-1566

       

      Is this supposed to be fixed, Is there a workaround? Tomcat now hangs on shutdown.

       

      I'm tried using 3.0.0.beta4 and the current master.

       

      Thx,

       

      --Kurt

        • 1. Re: Shutdown issue
          rhauch

          There are two forms of ModeShapeEngine.shutdown(...) - which are you calling.

           

          Note that these methods return a Future<Boolean>. If you want to block until the repository is shutdown, you need to call "get()" to wait until the engine is shutdown or "get(long,TimeUnit)" to wait at most the specified time until the engine is shutdown.

           

          The garbage collection process runs using this "modeshape-cron-*" thread every 5 minutes. By chance does Tomcat shutdown after 5-6 minutes? If so, that'll help narrow down the issue.

          • 2. Re: Shutdown issue
            kurtstam

            I'm calling

            ((org.modeshape.jcr.api.RepositoryFactory)theFactory).shutdown().get();

            which actually returns without any delay, but after 20 min tomcat still hangs.

             

            --Kurt

            • 3. Re: Shutdown issue
              rhauch

              Okay, great. I'll reopen the issue, and we'll try to fix it ASAP.

              • 4. Re: Shutdown issue
                rhauch

                The problem turned out to be an invalid namespace prefix (see MODE-1655), which prevented the repository from starting up properly, and which prevented the repository from shutting down properly. Fixing the namespace prefix problem corrected the issue.