hub-cap/sneaky-pete — pull request #30 by TimSimpsonR (2011-11-21 21:11:32+00:00)
Title: Lock out sql status update during preview, improved Rabbit resilience, made SP declare exchanges identically to Nova

* Moved the code to reconnect to rabbit to its own class after it became even more complex and created the ResilentReceiver.
* Discovered and fixed a pretty awful memory leak in the AmqpConnection class which occurred when an exception was thrown from the constructor.
* The exchange name was defined in the flags in Nova, so I added that to Sneaky Pete.
* I was defining the exchange as "direct", not "topic" like Nova. Fixed it.
* An exception could be thrown in the AmqpChannel smart pointer release method. Decided too many classes might use a smart pointer as a field and thus call this in their destructor, so I made it safer.
* Changed how I declared the exchange until I got it the same as Novas.
* Added code to catch issues with librabbit connections and automatically reconnect before preceding. It even sleeps for a time defined in the flags before attempting to connect again.
* Tried as hard as I could to ignore SIGPIPE but could not. Librabbit-c raises this signal when the socket to Rabbit is closed (when Rabbit dies) even when you're closing the thing. This is a known issue, and the solution is to ignore the signal, but I just could not get it to work. Instead, I changed the librabbit library code where "send" was being called. I left what I attempted in this commit for future reference.
* Added try / catches around nearly everything in the receiver_daemon so things like disconnects from the Nova infastructure DB won't kill Sneaky Pete.
* The issues with reconnecting to Rabbit are not yet 100% solved- there is an integration test I'm writing in the Reddwarf code base which does not yet fully pass.
* Set new record for self-promoting bullet points in a Github pull request.