Qpid
  1. Qpid
  2. QPID-3812

[Java] ExceptionListenerTest sporadically fails on java-mms-0.10

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.15
    • Fix Version/s: 0.15
    • Component/s: Java Broker
    • Labels:
      None
    • Environment:

      Linux ubuntu 2.6.35-32-server #64-Ubuntu SMP Tue Jan 3 02:11:24 UTC 2012 x86_64 GNU/Linux

      Description

      Profile: java-mms.0-10

      Test: testBrokerDeath
      Class: org.apache.qpid.test.unit.client.connection.ExceptionListenerTest

      junit.framework.AssertionFailedError: exception listener was not fired  
      at org.apache.qpid.test.unit.client.connection.ExceptionListenerTest.testBrokerDeath(ExceptionListenerTest.java:58)  
      at org.apache.qpid.test.utils.QpidTestCase.runBare(QpidTestCase.java:186)  
      at org.apache.qpid.test.utils.QpidTestCase.run(QpidTestCase.java:220)
      

        Activity

        Hide
        Keith Wall added a comment -

        This is a race condition. The Broker is sending the ConnectionOpenOk back to the client before it has updated its ConnectionRegistry. This leaves open the possibility that the ExceptionListenerTest can shut the broker down before the client's connection is registered internally, meaning that the Broker won't close the connection and the client won't get to report the exception to the client app.

        BROKER: IoReceiver - /127.0.0.1:36012 2012-02-03 17:48:38,871 DEBUG [apache.qpid.transport.Connection] SEND: [conn:621e4cf0] ch=0 ConnectionOpenOk(knownHosts=[])
        CLIENT: IoReceiver - localhost/127.0.0.1:15672 2012-02-03 17:48:38,871 DEBUG [apache.qpid.transport.Connection] RECV: [conn:3e0245c] ch=0 ConnectionOpenOk(knownHosts=null)
        CLIENT: main 2012-02-03 17:48:38,871 DEBUG [qpid.test.utils.QpidBrokerTestCase] %%%%%%%%%%%%%%%% Stopping Broker %%%%%%%%%%%%%%%%%%%%%
        CLIENT: main 2012-02-03 17:48:38,871 INFO [qpid.test.utils.QpidBrokerTestCase] stopping broker on port : 15672
        ..
        BROKER: main 2012-02-03 17:48:38,872 DEBUG [qpid.server.connection.ConnectionRegistry] Closing connection registry :0 connections.
        ..
        BROKER: IoReceiver - /127.0.0.1:36012 2012-02-03 17:48:38,872 INFO [qpid.message.connection.open] [con:726(clientid@/127.0.0.1:36012/test)] CON-1001 : Open : Client ID : clientid : Protocol Version : 0-10
        

        It looks to me like problem is with ServerConnectionDelegate.java, line 172. The Broker should be updating its internal state before sending the ConnectionOpenOk.

        Show
        Keith Wall added a comment - This is a race condition. The Broker is sending the ConnectionOpenOk back to the client before it has updated its ConnectionRegistry. This leaves open the possibility that the ExceptionListenerTest can shut the broker down before the client's connection is registered internally, meaning that the Broker won't close the connection and the client won't get to report the exception to the client app. BROKER: IoReceiver - /127.0.0.1:36012 2012-02-03 17:48:38,871 DEBUG [apache.qpid.transport.Connection] SEND: [conn:621e4cf0] ch=0 ConnectionOpenOk(knownHosts=[]) CLIENT: IoReceiver - localhost/127.0.0.1:15672 2012-02-03 17:48:38,871 DEBUG [apache.qpid.transport.Connection] RECV: [conn:3e0245c] ch=0 ConnectionOpenOk(knownHosts= null ) CLIENT: main 2012-02-03 17:48:38,871 DEBUG [qpid.test.utils.QpidBrokerTestCase] %%%%%%%%%%%%%%%% Stopping Broker %%%%%%%%%%%%%%%%%%%%% CLIENT: main 2012-02-03 17:48:38,871 INFO [qpid.test.utils.QpidBrokerTestCase] stopping broker on port : 15672 .. BROKER: main 2012-02-03 17:48:38,872 DEBUG [qpid.server.connection.ConnectionRegistry] Closing connection registry :0 connections. .. BROKER: IoReceiver - /127.0.0.1:36012 2012-02-03 17:48:38,872 INFO [qpid.message.connection.open] [con:726(clientid@/127.0.0.1:36012/test)] CON-1001 : Open : Client ID : clientid : Protocol Version : 0-10 It looks to me like problem is with ServerConnectionDelegate.java, line 172. The Broker should be updating its internal state before sending the ConnectionOpenOk.
        Hide
        Keith Wall added a comment -

        Hi Robbie, can you review this commit please?

        Show
        Keith Wall added a comment - Hi Robbie, can you review this commit please?
        Hide
        Robbie Gemmell added a comment -

        Changes look reasonable to me.

        Show
        Robbie Gemmell added a comment - Changes look reasonable to me.

          People

          • Assignee:
            Robbie Gemmell
            Reporter:
            Keith Wall
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development