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.
|