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