Keith Wall created QPID-6672:
--------------------------------

             Summary: Message dispatching after dispatcher close can cause 
thread to terminate with IllegalStateException
                 Key: QPID-6672
                 URL: https://issues.apache.org/jira/browse/QPID-6672
             Project: Qpid
          Issue Type: Bug
          Components: Java Client
            Reporter: Keith Wall


There is a race between the dispatcher thread and another thread closing a 
session.  In the unlucky case, the dispatcher thread can die with an ISE as 
below.

The issue appears to be that the Dispatcher#close method does not await the 
shutdown for the dispatcher before returning, so the Dispatcher may run on for 
another iteration whilst the dispatcher reference has been nulled.

This appears to be a longstanding issue and is showing up now owing to 
r1693225, which makes uncaught exceptions fail the test.

{noformat}
2015-07-29 18:16:37,498         ERROR [Dispatcher-4-Conn-32] 
o.a.q.t.LoggingUncaughtExceptionHandler Uncaught exception in thread 
"Dispatcher-4-Conn-32"
java.lang.IllegalStateException: dispatcher is not started
        at org.apache.qpid.client.AMQSession.dispatch(AMQSession.java:3267) 
~[qpid-client-6.0.0-SNAPSHOT.jar:na]
        at 
org.apache.qpid.client.message.UnprocessedMessage.dispatch(UnprocessedMessage.java:54)
 ~[qpid-client-6.0.0-SNAPSHOT.jar:na]
        at 
org.apache.qpid.client.AMQSession$Dispatcher.run(AMQSession.java:3408) 
~[qpid-client-6.0.0-SNAPSHOT.jar:na]
        at java.lang.Thread.run(Thread.java:745) ~[na:1.7.0_67]

{noformat}





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to