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

ThreadPerSessionEventHandlingStrategy still leaks threads

    Details

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

      Description

      See http://www.quickfixj.org/jira/browse/QFJ-326

      I'd like this to be reopened as threads still leak.
      1. in ThreadPerSessionEventHandlingStrategy.stopDispatcherThreads the dispatchers.clear() is done before looping through the collection and so threads' stopDispatcher is never called
      2. ThreadPerSessionEventHandlingStrategy.MessageDispatchingThread.run never terminates as this method repeatedly calls getNextMessage in a loop and getNextMessage calls messages.take which blocks indefinitely
      3. also, stopDispatcherThreads should wait for threads to terminate before it returns so that everything gets cleaned up properly and in order

      I've got a patch which fixes these by:
      1. reordering statements in stopDispatcherThreads
      2. using messages.poll which times out. Have set up a constant timeout of 10 seconds
      3. waiting for threads to finish

      What do people think about the timeout value? We could make this timeout configurable, or higher.

        Attachments

        1. 410.patch
          4 kB
          Jerry Shea
        2. 410-2.patch
          4 kB
          Jerry Shea
        3. ThreadPerSessionEventHandlingStrategy.java
          6 kB
          Andre Mermegas

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jerryshea Jerry Shea
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: