[Backgroundrb-devel] 0.2.0 worker/slave creation

Jason Sydes jasonsydes at gmail.com
Wed Nov 15 21:03:56 EST 2006

On 11/15/06, James Hughes <hughes.james at gmail.com> wrote:

> I'm seeing "Starting WorkerLogger" in the log, but no ResultsLogger.
> Subsequently, when I assign to the results hash in my worker it
> disappears into neverland. Could this be the problem I'm experiencing?

Maaaybe.  The Results and Logger workers get started when you start
backgroundrb w/ "script/backgroundrb start", long before you create a new
worker (or even start rails).  Then again, the Results and Logger workers
are mostly just regular workers that get initialized the same way as other
workers, so they may be getting 'lost' in the same way?  Not sure!

You may want to try the 'end.join' fix that skaar just checked in (
http://backgroundrb.devjavu.com/projects/backgroundrb/changeset/154), which
I believe should fix at least the problem I originally described:
In vendor/plugins/backgroundrb/server/lib/backgroundrb/middleman.rb, just
change the closing 'end' of the '@thread_pool.dispatch do' block to '

You're not seeing "In ResultsWorker" in backgroundrb.log.  Are you using
release-0.2.0, or are you working from the trunk?  What do you see when you
ps aux |grep backgroundrb

Maybe you're assigning to the results hash incorrectly?  If you're doing
something like the following, it won't work (see the README):
  results[:other_key] = []
  results[:other_key] << "add to key"


On 11/7/06, Jason Sydes <jasonsydes at gmail.com> wrote:
> > We ran into some problems accessing a freshly created worker, and had to
> > insert a sleep of 1 second to get it to work.  It looks like Ezra and
> skaar
> > already know this:
> >
> > from middleman.rb:
> >         # HACK: there is a race in the worker/slave creation, we
> >         # currently need to sleep between create.
> >         sleep 0.1
> >
> > You might want to increase it to 1 second for those of us on slowly mac
> > books.
> >
> > Thanks for all your hard work on backgroundrb, it's a beautiful piece of
> > work!
> >
> > Jason
> >
> > _______________________________________________
> > Backgroundrb-devel mailing list
> > Backgroundrb-devel at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/backgroundrb-devel
> >
> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20061115/6ae9a85a/attachment.html 

More information about the Backgroundrb-devel mailing list