« Return to Thread: misbehaviour of "com.swiftmq.jms.ConnectionLostException: Connection closed"

misbehaviour of "com.swiftmq.jms.ConnectionLostException: Connection closed"

by Leos Bitto :: Rate this Message:

Reply to Author | View in Thread

Hello,

I use SwiftMQ 7.5.1 and my application uses just one JMS connection, but with many sessions (each thread of my application uses one session). When I shutdown the SwiftMQ router while my application runs, after some time (any hint how this time can be configured?) one of my threads gets this JMSException when trying to commit its JMS session:

com.swiftmq.jms.ConnectionLostException: Connection closed
        at com.swiftmq.jms.ExceptionConverter.convert(Unknown Source)
        at com.swiftmq.jms.v750.SessionImpl.commit(Unknown Source)
        at my.class.run(MyClass.java:498)
        at java.lang.Thread.run(Thread.java:619)

This thread has the possibility to react on this JMSException by periodically trying to create a new JMS connection until it succeeds (after I start the SwiftMQ router again). However, the other threads seem to get stuck with this thread dump:

"Handler2_2" prio=6 tid=0x2ded7800 nid=0xa18 in Object.wait() [0x310ff000..0x310ffa14]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x04730a40> (a com.swiftmq.tools.concurrent.Semaphore)
        at java.lang.Object.wait(Object.java:485)
        at com.swiftmq.tools.util.UninterruptableWaiter.doWait(Unknown Source)
        at com.swiftmq.tools.concurrent.Semaphore.waitHere(Unknown Source)
        - locked <0x04730a40> (a com.swiftmq.tools.concurrent.Semaphore)
        at com.swiftmq.tools.requestreply.RequestRegistry.request(Unknown Source)
        at com.swiftmq.jms.v750.SessionImpl.requestTransaction(Unknown Source)
        at com.swiftmq.jms.v750.SessionImpl.commit(Unknown Source)
        at my.class.run(MyClass.java:498)
        at java.lang.Thread.run(Thread.java:619)

"Handler1_1" prio=6 tid=0x2c6b6800 nid=0x1308 in Object.wait() [0x3105f000..0x3105fb14]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x04730a88> (a com.swiftmq.tools.concurrent.Semaphore)
        at java.lang.Object.wait(Object.java:485)
        at com.swiftmq.tools.util.UninterruptableWaiter.doWait(Unknown Source)
        at com.swiftmq.tools.concurrent.Semaphore.waitHere(Unknown Source)
        - locked <0x04730a88> (a com.swiftmq.tools.concurrent.Semaphore)
        at com.swiftmq.tools.requestreply.RequestRegistry.request(Unknown Source)
        at com.swiftmq.jms.v750.SessionImpl.requestTransaction(Unknown Source)
        at com.swiftmq.jms.v750.SessionImpl.commit(Unknown Source)
        at my.class.run(MyClass.java:498)
        at java.lang.Thread.run(Thread.java:619)

Both these threads call session.commit(), one has one MessageProducer, the other has one MessageConsumer in their JMS session. Like the name UninterruptableWaiter indicates, these threads cannot be interrupted - they even prevent me from shutting down my whole application, so I have to use kill -9 which is not nice. I would expect that the call to session.commit() should result in JMSException in this case for all my threads, not just one. Why does this not happen, is that a bug in the SwiftMQ code?


Leos Bitto

 « Return to Thread: misbehaviour of "com.swiftmq.jms.ConnectionLostException: Connection closed"