On Fri, Apr 05, 2013 at 11:31:09AM -0700, Steve Sexton wrote:
>
> On Tuesday, April 2, 2013 5:27:13 PM UTC-4, John Mettraux wrote:
> >
> > yes, you'd better call shutdown on Engine/Dashboard. It will, as Farrel
> > mentioned, call the shutdown methods of all the ruote components.
> >
> I had a chance to test this today, and sadly, it does not shutdown "all"
> ruote components. It only does a shutdown for components active in the OS
> process in which the shutdown method was called.
Hello Steve,
I just re-read the thread. Sorry, I did not guess you wanted to shut down all
the workers in one go.
> Specifically, if you use
> the rake task provided with ruote-kit to run a worker in a separate
> process, it will not receive the shutdown message. Which means that if
> shutdown is important, the rake task in ruote-kit should never be used.
Clearly, it lacks signal/exit handling. That can be taken care of. Any
thing I should be wary of before I proceed?
An at_exit handler could help, but I guess it doesn't prevent a cold kill.
> Looking through the code, it appears that the shutdown methods of services
> are called directly, via instance variables and local methods, and not by
> using a broadcast message like I was hoping/expecting.
Maybe this can help:
https://github.com/jmettraux/ruote/blob/1c8a0741ee5d338787bda6743975ef3eab7704cc/lib/ruote/dashboard.rb#L1051-L1097
I'm not too happy with it though. The state checking loop needs tightening.