[QFJ-326] ThreadPerSessionEventHandlingStrategy leaks threads! Created: 05/Aug/08 Updated: 20/Apr/09 Resolved: 26/Nov/08 |
|
Status: | Closed |
Project: | QuickFIX/J |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | 1.4.0 |
Type: | Bug | Priority: | Major |
Reporter: | Dan Mihai Dumitriu | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | None |
Description |
Threads created by ThreadPerSessionEventHandlingStrategy are never shutdown. This is probably not an issue most of the time. In our case, however, we dynamically create sessions when accepting, much like in the Executor.java example. Threads are never, ever shutdown, even if the session is logged out. |
Comments |
Comment by Steve Bate [ 05/Aug/08 ] |
Yes, this would be an issue with dynamically created sessions. Have you considered using the SocketAcceptor instead of ThreadedSocketAcceptor? |
Comment by Dan Mihai Dumitriu [ 05/Aug/08 ] |
Yea, certainly we could switch to the single threaded SocketAcceptor, for now. Longer term, however, the issue should probably be addressed. There are probably not too many people using the dynamic sessions, right? |
Comment by Steve Bate [ 05/Aug/08 ] |
The dynamic sessions were added primarily to support FIX simulators where you might not know the identity of counterparties before they connect. The issue you raised is valid. There are also other related issues. In general, the dynamic session support gives the ability to create new sessions on the fly but not the ability for those sessions (and associated resources) to be destroyed. For example, the sessions will not be garbage collected after logout and this could be considered a memory leak if there are a large number of dynamically created sessions. We need functionality added to the dynamic session support to allow automatically destroying a session after logout (or maybe after it's been logged out for a specified period of time). |
Comment by Jerry Shea [ 27/Feb/09 ] |
I'd like this to be reopened as threads still leak. I've got a patch which fixes these by: What do people think about the timeout value? We could make this timeout configurable, or higher. |
Comment by Jerry Shea [ 02/Mar/09 ] |
I can't upload the patch - is that because this issue is closed? |
Comment by Jörg Thönnes [ 03/Mar/09 ] |
In reply to comment #5: How about creating a follow-up ticket? This ticket has been included into version 1.4.0 You could refer to this ticket, of course. |
Comment by Jerry Shea [ 20/Apr/09 ] |
Follow up ticket created - http://www.quickfixj.org/jira/browse/QFJ-410 |