[Backgroundrb-devel] Feedback on RC2

hemant kumar gethemant at gmail.com
Wed Dec 5 21:54:05 EST 2007

On Wed, 2007-12-05 at 17:51 -0800, Andy Tyra wrote:
> I tried to upgrade my existing application to RC2 last night.  Like
> many, I use this mostly for running scheduled tasks.  For the moment,
> I've abandoned the effort, but am looking forward to being able to use
> this.  Feedback below: 
> First, the reason I was looking forward to this upgrade was to use the
> threaded scheduler.  I have an application with long-running tasks.  I
> found that scheduled tasks in previous versions of backgroundrb would
> not run if the worker scheduled before it was still running.  This
> seemed counterintuitive to me (given the whole idea behind
> backgroundrb) but after reading documentation and forums, it seems
> many others ran into this issue too.  RC2 planned to do away with
> this. 
> The Good:
> - (Still) Easy Installattion
> - Well designed.  Logging is centralized, that's nice.
> - Easy to hack up for use in an enterprise environment.
> The Bad:
> - Lots of arbitrary changes that I don't quite understand. Different
> function names to create workers, new YML formats, different config
> files for scheduler.  Would have been great if none of the rails
> application-facing stuff changed so the new version could just be
> swapped in. 
> - Logging detail has greatly diminished.  It's difficult to
> troubleshoot what's happening when things go wrong.
> - For the moment, this seems less stable than the old version.  My
> scheduled tasks are bringing down the whole server and I can't tell
> why (nothing showing up in the logs). This is why I've abandoned the
> upgrade.  The scheduler is working fine for lightweight tasks, but the
> long-running ones just bring everything down.  For what it's worth,
> the logic for the tasks still lives in my rails models.  The workers
> basically just call class methods in the models.  (Truly using this as
> a scheduler.)  Perhaps this has something to do with it? 
> - Documentation and resources for the new version are sparse
> (obviously) and seem a little inaccurate.  For example, I learned that
> the MiddleMan.ask_worker() method detailed in the docs is actually
> called as MiddleMan.ask_work ().

I also saw some typos in the documentation and hence fixing them.
> If anyone has any thoughts on what might be going wrong with my
> scheduled tasks, that'd be great.  Thanks!

There is definitely an exception being thrown in your worker thats not
handled. if possible, please wrap your worker method in a begin rescue
and see what happens. Currently, before daemonizing workers, i am
redirecting their STDOUT,STDIN and STDERR to a file, so as unhandled
exceptions gets logged. I will get this better. Long running schedulers
are most important thing and hence any bug will be fixed with atmost

Also, regarding multi tasksing that you want to achieve. New release of
bdrb basically encourages cooperative multitasking not preemtpive
multitasking of threads.I will code some examples for this.

Thanks for your patience and please try the fix i suggested.

More information about the Backgroundrb-devel mailing list