[QFJ-410] ThreadPerSessionEventHandlingStrategy still leaks threads Created: 04/Mar/09 Updated: 15/Nov/12 Resolved: 05/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: | Default |
| Reporter: | Jerry Shea | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
See http://www.quickfixj.org/jira/browse/QFJ-326 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. |
| Comments |
| Comment by Jerry Shea [ 04/Mar/09 ] |
|
Here's the patch. I changed the timeout to 2 seconds in my testing. |
| Comment by Jerry Shea [ 15/Jun/09 ] |
|
Have reduced the wait timeout to 250ms to make shutdown more responsive. |
| Comment by Jerry Shea [ 15/Jun/09 ] |
|
Guys, is there any chance we could get this change assigned to 1.4.1 release? Let me know if there's anything else I can do to help this along |
| Comment by Andre Mermegas [ 18/Dec/09 ] |
|
I have a similiar bugfix, i can't attach for some reason. /*******************************************************************************
package quickfix.mina; import quickfix.LogUtil; import java.util.Collection; /**
public void onMessage(Session quickfixSession, Message message) { dispatcher.enqueue(message); /** There is no such thing as a SesionConnector for thread-per-session handler - we don't multiplex
protected void startDispatcherThread(MessageDispatchingThread dispatcher) { dispatcher.start(); } public void stopDispatcherThreads() { } private class MessageDispatchingThread extends Thread { MessageDispatchingThread(Session session) { super("QF/J Session dispatcher: " + session.getSessionID()); quickfixSession = session; } public void enqueue(Message message) { catch (InterruptedException e) { quickfixSession.getLog().onEvent(e.getMessage()); }} public Message getNextMessage(BlockingQueue<Message> messages) throws InterruptedException { return messages.poll(1000L, TimeUnit.MILLISECONDS); }public int getQueueSize() { return messages.size(); } public void run() { } catch (InterruptedException e) { LogUtil.logThrowable(quickfixSession.getSessionID(), "Message dispatcher interrupted", e); return; }catch (Throwable e) { LogUtil.logThrowable(quickfixSession.getSessionID(), "Error during message processing", e); } stopped = !quickfixSession.hasResponder(); public void stopDispatcher() { stopped = true; } } return ret; } |
| Comment by Andre Mermegas [ 06/Apr/10 ] |
|
that patch didn't work for me, threads were not ending. attached my fix. |
| Comment by Andre Mermegas [ 06/Apr/10 ] |
|
should probably make getNextMessage(...) private too. |