[QFJ-943] Blocking queue writes from the MINA event loop causing delayed sends, missing heartbeats, spurious disconnects Created: 25/Jan/18  Updated: 02/Aug/18  Resolved: 06/Mar/18

Status: Closed
Project: QuickFIX/J
Component/s: Networking
Affects Version/s: 1.6.4
Fix Version/s: 2.1.0

Type: Bug Priority: Major
Reporter: Mr. Bald Assignee: Mr. Bald
Resolution: Fixed Votes: 0
Labels: None
Environment:

any, reproduced on x86_64 Windows, Linux, Mac OS X, Oracle JVM 1.8



 Description   

AbstractPollingIoProcessor read buffer drain loop may block for substantial time.
This is because the QuickFIXj/MINA read filter chain eventually ends up in one of EventHandlingStrategy implementations (thread-per-session or shared), which in turn write messages into a fixed capacity blocking queue.

Reproduction - set up a NewOrderSingle generator and a simple Acceptor with delay of 20ms between subsequent ack ExecutionReport responses and a queue size of 1000. Pumping of 2000 NewOrderSingle messages into such Acceptor should be enough to see that execution reports are blocked at the Acceptor end until the sender stops sending new messages and the read queue of the Acceptor unblocks.

General idea of the fix - use watermarks-based queue instead of blocking queue. I'll do a github pull request shortly.



 Comments   
Comment by Christoph John [ 25/Jan/18 ]

Hi Mr. Bald,
you can specify the size of the blocking queue via the constructor of the EventHandlingStrategy. This will of course not prevent the original problem.
Please open PR against master then. Thanks in advance.
Chris.

Comment by Mr. Bald [ 28/Jan/18 ]

Pull request: https://github.com/quickfix-j/quickfixj/pull/168

Generated at Sat Nov 23 07:43:32 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.