[Backgroundrb-devel] [BUG] worker stopping abruptly

hemant gethemant at gmail.com
Wed Apr 18 11:01:25 EDT 2007


On 4/18/07, hemant <gethemant at gmail.com> wrote:
> I have been facing this damn ugly issue since quite sometime.
>
> So this worker reads RSS feed from Yahoo news and stores it in a DB.
> The worker is scheduled to run at every 40 minutes and my
> background_schedules.yml looks like this:
>
> feed_worker:
>   :class: :feed_worker
>   :job_key: :feed_worker_key
>   :worker_method: :do_work
>   :trigger_args:
>     :start: <%= Time.now + 5 %>
>     :repeat_interval: <%= 40*60 %>
>
> So story is, worker stops working suddenly. no exception thrown either
> in background.log or background_server.log.
>
> To also, to make sure that backgroundrb threads doesn't eat my
> excpetion my code looks like this:
>
> def do_work(args)
>   begin
>     logger.info "Starting the Yahoo feed worker on : #{Time.now}"
>     yahoo_url = "http://finance.yahoo.com/rss/headline?s="
>     symbol_list = NasdaqSymbols.find_all()
>
>     symbol_list.each do|sym|
>       temp_sym = sym.symbol.strip
>       temp_url = yahoo_url + temp_sym
>       get_feeds(temp_url,temp_sym) rescue next
>     end
>   rescue
>     logger.info $!
>     logger.info $!.backtrace
>   end
> end
>
> ^^^ could be naive, but the point is, why worker stops suddenly
> without any errors? Earlier I thought, may be logging has bug and
> worker is still running. But a quick check from database says
> otherwise.
>
> Following a full text of backgroundrb.log file:
>
>
> 20070417-15:51:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Tue Apr 17 15:51:01 +0530 2007
> 20070417-16:31:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Tue Apr 17 16:31:01 +0530 2007
> 20070417-17:11:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Tue Apr 17 17:11:01 +0530 2007
> 20070417-17:51:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Tue Apr 17 17:51:01 +0530 2007
> 20070417-18:31:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Tue Apr 17 18:31:01 +0530 2007
> 20070417-19:11:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Tue Apr 17 19:11:01 +0530 2007
> 20070417-19:51:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Tue Apr 17 19:51:01 +0530 2007
> 20070417-20:31:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Tue Apr 17 20:31:01 +0530 2007
> 20070417-21:11:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Tue Apr 17 21:11:01 +0530 2007
> 20070417-21:51:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Tue Apr 17 21:51:01 +0530 2007
> 20070417-22:31:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Tue Apr 17 22:31:01 +0530 2007
> 20070417-23:11:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Tue Apr 17 23:11:01 +0530 2007
> 20070417-23:51:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Tue Apr 17 23:51:01 +0530 2007
> 20070418-00:31:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 00:31:01 +0530 2007
> 20070418-01:11:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 01:11:01 +0530 2007
> 20070418-01:51:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 01:51:01 +0530 2007
> 20070418-02:31:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 02:31:01 +0530 2007
> 20070418-03:11:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 03:11:01 +0530 2007
> 20070418-03:51:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 03:51:01 +0530 2007
> 20070418-04:31:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 04:31:01 +0530 2007
> 20070418-05:11:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 05:11:01 +0530 2007
> 20070418-05:51:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 05:51:01 +0530 2007
> 20070418-06:31:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 06:31:01 +0530 2007
> 20070418-07:11:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 07:11:01 +0530 2007
> 20070418-07:51:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 07:51:01 +0530 2007
> 20070418-08:31:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 08:31:01 +0530 2007
> 20070418-09:11:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 09:11:01 +0530 2007
> 20070418-09:51:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 09:51:01 +0530 2007
> 20070418-10:31:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 10:31:01 +0530 2007
> 20070418-11:11:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 11:11:01 +0530 2007
> 20070418-11:51:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 11:51:01 +0530 2007
> 20070418-12:31:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 12:31:01 +0530 2007
> 20070418-13:11:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 13:11:01 +0530 2007
> 20070418-13:51:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 13:51:01 +0530 2007
> 20070418-14:31:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 14:31:01 +0530 2007
> 20070418-15:11:01 (22525) ***** Starting the Yahoo feed worker on Time
> : Wed Apr 18 15:11:01 +0530 2007
>

Another quick check in form of "ps aux|grep back" shows backgroundrb
running, but sadly feed worker didn't do its iteration after 3:11 PM.


More information about the Backgroundrb-devel mailing list