I'm running ActiveMQ on another machine and connecting via TCP.  If it dies
(I press CTRL-C, or may get an out of memory error) while I'm processing
messages then the consume gets stuck waiting for a message and never returns
(I'm calling receiveNoWait).  This is the stack trace where it is stuck in
jconsole...

Name: WorkerThread for PIQ Server manager 39
State: WAITING on java.lang.obj...@47eb38
Total blocked: 0  Total waited: 43

Stack trace: 
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:485)
org.apache.activemq.MessageDispatchChannel.dequeue(MessageDispatchChannel.java:75)
org.apache.activemq.ActiveMQMessageConsumer.dequeue(ActiveMQMessageConsumer.java:412)
org.apache.activemq.ActiveMQMessageConsumer.receiveNoWait(ActiveMQMessageConsumer.java:560)
….


At the same time I may see another ActiveMQ thread waiting (and not sure if
this is related or the cause)...

Name: ActiveMQ Connection Worker: tcp://2000-serve-base/192.168.1.9:61616
State: WAITING on
java.util.concurrent.locks.abstractqueuedsynchronizer$conditionobj...@16372aa
Total blocked: 0  Total waited: 3

Stack trace: 
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:946)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:906)
java.lang.Thread.run(Thread.java:619)


This causes me 2 problems - 
1. The client application can't cleanly shutdown as it is waiting for my
consumer thread to finish.
2. If ActiveMQ restarts my client doesn't automatically reconnect becasue
the consumer thread is still stuck.

Any ideas?

Ian
This means that when active MQ is restarted my client cannot automatically 
-- 
View this message in context: 
http://www.nabble.com/Client-threads-hang-if-ActiveMQ-dies-tp21354487p21354487.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to