Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-279

ChangeProcessor getting stuck while shutdown

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.5
    • 0.5
    • core
    • None

    Description

      o.a.j.oak.jcr.observation.ChangeProcessor is preventing system shutdown

      "FelixStartLevel" daemon prio=10 tid=0x00007fbda846e000 nid=0x78d5 waiting on condition [0x00007fbda41ce000]
         java.lang.Thread.State: WAITING (parking)
      	at sun.misc.Unsafe.park(Native Method)
      	- parking to wait for  <0x00000000b8931378> (a java.util.concurrent.CountDownLatch$Sync)
      	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
      	at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
      	at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:969)
      	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1281)
      	at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:207)
      	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor.stop(ChangeProcessor.java:76)
      	- locked <0x00000000b89312d0> (a org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor)
      	at org.apache.jackrabbit.oak.jcr.observation.ObservationManagerImpl.removeEventListener(ObservationManagerImpl.java:87)
      	- locked <0x00000000b8931210> (a org.apache.jackrabbit.oak.jcr.observation.ObservationManagerImpl)
      	at com.adobe.granite.workflow.core.eventsupport.JcrToWorkflowEventService.deactivate(JcrToWorkflowEventService.java:139)
      

      Complete thread dump would be attached.

      Looking at ChangeProcessor.stop [1] method it appears that latch would not be cleared if an exception is thrown in the run() method and running variable remains set to true.

      One possible solution is perform stopped.countDown(); in a finally block in case stopping is set to true. Further it appears that countDown should only be done in case stopping is true. Currently it is performed for every run

      [1] https://github.com/apache/jackrabbit-oak/blob/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java#L72

      Attachments

        1. OAK-279.patch
          1 kB
          Chetan Mehrotra
        2. stacktrace.txt
          6 kB
          Chetan Mehrotra

        Activity

          People

            mduerig Michael Dürig
            chetanm Chetan Mehrotra
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: