Tobias Overkamp
2009-Mar-12 14:43 UTC
[Backgroundrb-devel] timeout resp. handling of crash situations
Hi, (hope this is not a double post but I assume I have sent the first message from the wrong email address). I''m quite new to BackgroundRB but want to make use of it now in a project. One thing I currently don''t get (into my mind): What will happen if a worker (handled by the backgroundrb-Daemon) will die, crash, halt (perhaps due to power failure or similar things) during execution? I want to make use of the "enq_method" call to make sure that no request will get lost but I can not see any mechanism for a housekeeping after a crash. Do I miss something or do I have to query the database directly? Hope this is not an FAQ but I could not find any related queries/answers on Google etc. Best regards, Tobias.
Jonathan Wallace
2009-Mar-12 17:17 UTC
[Backgroundrb-devel] timeout resp. handling of crash situations
Hi Tobias, It sounds like you''re looking for a monitoring solution for your workers. I know some have used monit but I''m more familiar with god. http://blog.jonathanrwallace.com/2008/08/monitoring-backgroundrb-workers-with-god/ Good luck, Jonathan On Thu, Mar 12, 2009 at 10:43 AM, Tobias Overkamp <tov-backgroundrb at overkamp.org> wrote:> Hi, > (hope this is not a double post but I assume I have sent the first > message from the wrong email address). > > I''m quite new to BackgroundRB but want to make use of it now in a > project. > One thing I currently don''t get (into my mind): > > What will happen if a worker (handled by the backgroundrb-Daemon) will > die, crash, halt (perhaps due to power failure or similar things) during > execution? > I want to make use of the "enq_method" call to make sure that no request > will get lost but I can not see any mechanism for a housekeeping after a > crash. Do I miss something or do I have to query the database directly? > > Hope this is not an FAQ but I could not find any related queries/answers > on Google etc. > > Best regards, > > Tobias. > > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >
hemant
2009-Mar-12 17:57 UTC
[Backgroundrb-devel] timeout resp. handling of crash situations
On Thu, Mar 12, 2009 at 8:13 PM, Tobias Overkamp <tov-backgroundrb at overkamp.org> wrote:> Hi, > (hope this is not a double post but I assume I have sent the first > message from the wrong email address). > > I''m quite new to BackgroundRB but want to make use of it now in a > project. > One thing I currently don''t get (into my mind): > > What will happen if a worker (handled by the backgroundrb-Daemon) will > die, crash, halt (perhaps due to power failure or similar things) during > execution? > I want to make use of the "enq_method" call to make sure that no request > will get lost but I can not see any mechanism for a housekeeping after a > crash. Do I miss something or do I have to query the database directly? >Well if worker crashed for any reason, your unfinished tasks will remain marked as unfinished in bdrb_job_queue table and hence on restart you can decide what do do with them.
Tobias Overkamp
2009-Mar-12 20:11 UTC
[Backgroundrb-devel] timeout resp. handling of crash situations
Am 12.03.2009 um 18:57 schrieb hemant:> On Thu, Mar 12, 2009 at 8:13 PM, Tobias Overkamp > <tov-backgroundrb at overkamp.org> wrote: >> [...] >> I want to make use of the "enq_method" call to make sure that no >> request >> will get lost but I can not see any mechanism for a housekeeping >> after a >> crash. Do I miss something or do I have to query the database >> directly? >> > > Well if worker crashed for any reason, your unfinished tasks will > remain marked as unfinished in bdrb_job_queue table and hence on > restart you can decide what do do with them.Hi, but do you have any suggestion how to do this via backgroundrb? If I understand it correctly, it seems that a "taken" job will remain into this state until I finish it (using the finished method) or I perform an SQL update. Of course the SQL wouldn''t be that hard but I was just searching for an already implemented feature in backgroundrb. Jonathan Wallace has just recommended me to use "god" as a supervising daemon for backgroundrb (thanks for this, btw. :-) ). This will make sure that the workers keep running after crashes, but will it clean up the taken jobs? Don''t get me wrong: I think I''ll find a solution for tidying up (and of course I hope that my server will not crash that often) but somehow I have the feeling that this functionality should be part of backgroundrb. Regards, Tobias.