[Twisted-Python] Strange blocking in twisted + quickfix service
Hi Folks, I'm trying to wrap the quickfix engine (www.quickfix.org) with a twisted service, in order to create a standalone daemon that will respond to RPC-like commands (such as "start", "stop", "request quote", etc.) However, I'm finding some odd blocking issues that I need to resolve. Basically, the twisted service works fine until I start the quickfix engine (which runs, I believe in a separate thread). Beforehand, calls to the twisted protocol class I've created invoke methods in the service, and things don't block. When the quickfix engine is started, it runs fine, but the main thread, in which the twisted "wrapper" application runs, seems to block in funny ways. As an example of this behavior, a connection to the LineReceiver protocol class I've subclassed will start to execute, but hangs exactly 12 minutes before proceeding. I.e. the time between telnetting to the port on which the server is listening and entering a command, and the time when the logs record that the "lineReceived" method of the LineReceiver class is invoked, is 12 minutes. As far as I can tell, everything is running in the same thread except for the quickfix engine class, so I'm not sure what the hanging behavior is due to. My understanding is that the twisted.python.log module, which I'm using to log, is non-blobking, and so shouldn't be causing this behavior. Does anyone have any ideas into what might be causing the hang, and approaches to diagnosing the cause? Thanks so much, rob
On Wed, 15 Nov 2006 14:27:29 -0500, Robert Parrott <robparrott@gmail.com> wrote:
Hi Folks,
I'm trying to wrap the quickfix engine (www.quickfix.org)
ITYM www.quickfixengine.org :)
with a twisted service, in order to create a standalone daemon that will respond to RPC-like commands (such as "start", "stop", "request quote", etc.) However, I'm finding some odd blocking issues that I need to resolve.
Basically, the twisted service works fine until I start the quickfix engine (which runs, I believe in a separate thread). Beforehand, calls to the twisted protocol class I've created invoke methods in the service, and things don't block. When the quickfix engine is started, it runs fine, but the main thread, in which the twisted "wrapper" application runs, seems to block in funny ways.
Does QuickFIX release the GIL? If not, even if it runs in a separate thread, Twisted will be blocked any time it spends a long time doing anything. Jean-Paul
participants (2)
-
Jean-Paul Calderone
-
Robert Parrott