Qpid
  1. Qpid
  2. QPID-3812

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

    Details

    • Type: Bug Bug
    • Status: Resolved
    • 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

        Keith Wall created issue -
        Keith Wall made changes -
        Field Original Value New Value
        Link This issue is a clone of QPID-1426 [ QPID-1426 ]
        Keith Wall made changes -
        Link This issue is a clone of QPID-1426 [ QPID-1426 ]
        Keith Wall made changes -
        Summary [Java] ExceptionListenerTest Failure [Java] ExceptionListenerTest sporadically fails on java-mms-0.10
        Affects Version/s 0.15 [ 12319043 ]
        Affects Version/s M3 [ 12312117 ]
        Affects Version/s M4 [ 12313279 ]
        Environment Linux ubuntu 2.6.35-32-server #64-Ubuntu SMP Tue Jan 3 02:11:24 UTC 2012 x86_64 GNU/Linux

        Priority Minor [ 4 ] Major [ 3 ]
        Description 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)

        Profile: java-mms.0-10

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

        {code}
        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)
        {code}
        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.
        Keith Wall made changes -
        Assignee Keith Wall [ k-wall ]
        Keith Wall made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Keith Wall made changes -
        Status In Progress [ 3 ] Ready To Review [ 10006 ]
        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?
        Keith Wall made changes -
        Assignee Keith Wall [ k-wall ] Robbie Gemmell [ gemmellr ]
        Keith Wall made changes -
        Fix Version/s 0.15 [ 12319043 ]
        Hide
        Robbie Gemmell added a comment -

        Changes look reasonable to me.

        Show
        Robbie Gemmell added a comment - Changes look reasonable to me.
        Robbie Gemmell made changes -
        Status Ready To Review [ 10006 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development