Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-211

Race Condition/NPE on Session.disconnect()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Default
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 1.3.0
    • Component/s: Engine
    • Labels:
      None

      Description

      I'm seeing the following show up when i kill the connection to my FIX destination:
      <20070713-01:24:51, FIX.4.4:test-quote-asker->test-exchange, event> (Forcibly disconnecting session)
      <20070713-01:24:51, FIX.4.4:test-quote-asker->test-exchange, event> (Disconnecting)
      <20070713-01:24:51, FIX.4.4:test-quote-asker->test-exchange, event> (Disconnecting)
      18:24:51,172 ERROR [SocketConnectorIoProcessor-1.0] mina.initiator.InitiatorIoHandler (AbstractIoHandler.java:77) - protocol handler exception
      jjava.lang.NullPointerException
      at quickfix.Session.disconnect(Session.java:1369)
      at quickfix.mina.AbstractIoHandler.sessionClosed(AbstractIoHandler.java:99)

      This happens in Session.disconnect(), where we have the following code:
      if (hasResponder()) {
      getLog().onEvent("Disconnecting");
      NPE>>>> getResponder().disconnect();

      both hasResponder() and getResponder() are protected with synchronized(responderSync), but it seems that we have a situation where the responder itself disappears between the call to hasResponder() and when it's being used.

      Perhaps we need to put a bigger lock around the whole test/get/use structure?

        Attachments

          Activity

            People

            • Assignee:
              admin Steve Bate
              Reporter:
              toli Toli Kuznets
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: