[QFJ-491] ThreadPerSessionEventHandlingStrategy leaks threads Created: 18/Dec/09  Updated: 15/Nov/12  Resolved: 04/Apr/10

Status: Closed
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.4.0
Fix Version/s: 1.5.0

Type: Bug Priority: Major
Reporter: Andre Mermegas Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates QFJ-410 ThreadPerSessionEventHandlingStrategy... Closed
is duplicated by QFJ-492 re: ThreadPerSessionEventHandlingStra... Closed
Relates
is related to QFJ-410 ThreadPerSessionEventHandlingStrategy... Closed

 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.



 Comments   
Comment by Steve Bate [ 15/Jan/10 ]

Can you attach your patch, please?

Comment by Jerry Shea [ 13/Feb/10 ]

Patch is attached to http://www.quickfixj.org/jira/browse/QFJ-410

Comment by Steve Bate [ 04/Apr/10 ]

See linked issue

Generated at Sat Nov 23 11:10:20 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.