[Quickfix-developers] General and specific queries about the Ruby port
Brought to you by:
orenmnero
From: Robert R. <ro...@le...> - 2015-06-25 16:37:26
|
I'm using quickfix 1.14.3.1 on ruby 2.2.2p95 on Mac OS 10.10.3 (development) and Centos 5.10. (deployment) I'm putting together a drop copy engine connecting to Turquoise. The basic parsing side of things works very well. But my problems begin when it comes to preparing the application for production. In particular I cannot get the program to logout of the exchange successfully. Ideally I want my program to cleanly disconnect from the exchange in the following circumstances: 1. The exchange tells me to logout. 2. The program receives a SIGTERM or SIGINT 3. The current time is outside of StartTime/EndTime. 1 works - the exchange kicks me off, I respond to the logout and all is sweetness and light. We'll come back to 2. But 3 appears to not work. My settings file has the following information: UseLocalTime=Y StartTime=15:43:00 EndTime=15:43:59 StartDay=Monday EndDay=Tuesday It's currently 16:59 here in the UK, on Thursday. But the application will start without complaint. Similar tests with the time passing EndTime also fail. So question 1: QUESTION 1: Should the time handling code work on Ruby? On to part 2. I've added signal handlers and verified that they're called when the relevant signal is received. They set a global variable. The main "do-nothing" loop ejects when the variable is set. This bit works, although it seems that the Quickfix thread is a bit tenacious since the program only notices the signal after the HeartBtInt interval. The problem arises when I try to actually logout of the session and/or stop the initiator. If initiator.stop is called then the program runs to completion and then throws a Segmentation fault with the following backtrace: 0 libruby.2.2.0.dylib 0x00000001075f8445 rb_vm_bugreport + 149 1 libruby.2.2.0.dylib 0x000000010749c719 rb_bug_context + 473 2 libruby.2.2.0.dylib 0x0000000107572653 sigsegv + 83 3 libsystem_platform.dylib 0x00007fff96af6f1a _sigtramp + 26 4 quickfix.bundle 0x000000010823e635 _ZN3FIX7SessionD2Ev + 53 5 ??? 0x00007fff587afa60 0x0 + 140734677842528 If I instead call Session.lookupSession(<<<sessionid, stored away earlier>>>).logout (without calling initiator.stop), then the program runs to completion, but the logout call doesn't appear to do anything - no log of any outgoing messages. So, second question: QUESTION 2: What's the appropriate way to handle an unscheduled termination of a Ruby Quickfix program? And finally, the general question: QUESTION 3: Am I mad to do serious production development in Quickfix Ruby? It is seriously lacking in documentation and whilst it's been fun ferreting around the source (C++ and Ruby) to get the meat of my application running, I fear these deployment issues are going to stop me actually getting the code accepted by the exchange. Is anyone using the gem to do real work, or should I dust off my C++ skills (from 1997...) and sacrifice all the meta-programming goodness that made writing the actual parse module straightforward? Thanks for any pointers, help, brickbats, whatever. Rob. |