[ 
https://issues.apache.org/jira/browse/AMQ-4886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13941737#comment-13941737
 ] 

Gary Tully commented on AMQ-4886:
---------------------------------

I see a scenario where the broker fails to stop and hence is not restarted. the 
problem lies in leveldb deadlock in stop.
waiting on the executor completion with in the sync block stopps the inprogress 
tasks from completing. the wait must be outside the sync.
Thread dump is  {code}
Send blocked Thread[Timer-0,5,main]
     sun.misc.Unsafe.park(Native Method)
     java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:196)
     
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025)
     
java.util.concurrent.ThreadPoolExecutor.awaitTermination(ThreadPoolExecutor.java:1261)
     org.apache.activemq.leveldb.LevelDBClient.stop(LevelDBClient.scala:985)
     org.apache.activemq.leveldb.DBManager.stop(DBManager.scala:640)
     org.apache.activemq.leveldb.LevelDBStore.doStop(LevelDBStore.scala:276)
     org.apache.activemq.util.ServiceSupport.stop(ServiceSupport.java:71)
     
org.apache.activemq.broker.TransactionBroker.stop(TransactionBroker.java:197)
     org.apache.activemq.broker.BrokerService$5.stop(BrokerService.java:2169)
     org.apache.activemq.util.ServiceStopper.stop(ServiceStopper.java:41)
     org.apache.activemq.broker.BrokerService.stop(BrokerService.java:762)
     org.apache.activemq.bugs.AMQ2149Test$1RestartTask.run(AMQ2149Test.java:467)
     java.util.TimerThread.mainLoop(Timer.java:512)
     java.util.TimerThread.run(Timer.java:462)
Send blocked Thread[Thread-14,5,main]
     
org.apache.activemq.leveldb.LevelDBClient.wal_append_position(LevelDBClient.scala:967)
     
org.apache.activemq.leveldb.LevelDBClient.nextIndexSnapshotPos(LevelDBClient.scala:1052)
     
org.apache.activemq.leveldb.LevelDBClient.copyDirtyIndexToSnapshot(LevelDBClient.scala:1055)
     
org.apache.activemq.leveldb.LevelDBClient.snapshotIndex(LevelDBClient.scala:1098)
     
org.apache.activemq.leveldb.LevelDBClient$$anonfun$post_log_rotate$1.apply$mcV$sp(LevelDBClient.scala:643)
     org.fusesource.hawtdispatch.package$$anon$4.run(hawtdispatch.scala:357)
     
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
     
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
     java.lang.Thread.run(Thread.java:695)
{code}

> AMQ2149LevelDBTest hangs or fails frequently
> --------------------------------------------
>
>                 Key: AMQ-4886
>                 URL: https://issues.apache.org/jira/browse/AMQ-4886
>             Project: ActiveMQ
>          Issue Type: Bug
>            Reporter: Kevin Earls
>            Assignee: Kevin Earls
>         Attachments: AMQ2149LevelDBTest.stack
>
>
> I'll update this as I get more information, but this test suite has multiple 
> cases that hang and timeout frequently 
> (testTopicTransactionalOrderWithRestart and testTopicOrderWithRestart seem to 
> do so most frequently.)  
> It can also hang in tearDown, which causes the whole suite to hang without 
> timing out, which can be a problem when run under Hudson or Jenkins.  
> I will  attach a stack trace of the tearDown hang, and also update 
> AMQ2149Test to prevent this.  I'm also going to update the test to use JUnit4 
> and reduce the timeouts from 30 to 5 minutes.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to