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

ThreadPerSessionEventHandlingStrategy leaks threads

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • 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

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                andmer Andre Mermegas
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: