[Backgroundrb-devel] Worker suicide

John O'Shea joshea at nooked.com
Thu Jan 10 18:22:44 EST 2008

	Thanks for the pointer, works well on HEAD.  For the benefit of  
others, the all_worker_info method returns an array of hashes (one for  
each worker) containing the following keys
:worker (value is name)
:job_key (value is an empty string if no job key assigned)
:status (value seems to be hardcoded to 'running')

I'm not sure if the hardcoded status is intentional but I'm working  
around with something like

@workers = MiddleMan.all_worker_info
@workers.each { |worker|
   worker[:status]= worker[:job_key].empty? ?
     MiddleMan.ask_status(:worker => worker[:worker]) :
     MiddleMan.ask_status(:worker => worker[:worker], :job_key =>  


On 10 Jan 2008, at 20:16, hemant wrote:

> On Jan 11, 2008 1:12 AM, John O'Shea <joshea at nooked.com> wrote:
>> By co-incidence I have the same use case - the (dynamically  
>> created) worker
>> process is exiting just fine when it hits the exit at the end of  
>> the create
>> method.  However, subsequent calls to MiddleMan.query_all_workers  
>> still
>> lists the worker and its last known status.  I have a web UI for  
>> monitoring
>> worker activity so this is a little misleading for our admins.
> Thats intentional, although name is a misnomer I admit. But if you
> want to find the workers which are currently running,use
> MiddleMan.all_worker_info
>> Is there any way to get the master to realize the worker is gone?   
>> I am also
>> seeing "Some read error" messages in the backroundrb console and  
>> judging
>> from a related discussion at
>> http://rubyforge.org/pipermail/backgroundrb-devel/2007-December/001146.html
>> the master isn't cleaning up the socket connection to the worker (and
>> removing the worker from its internal lists).
>> (I'm running from the 1.0 release tag btw).
> Master DOES realize when a worker is gone and please upgrade to trunk
> or 1.0.1 release. Its rather important and above
> method(all_worker_info) has been added in 1.0.1 only.
> -- 
> Let them talk of their oriental summer climes of everlasting
> conservatories; give me the privilege of making my own summer with my
> own coals.
> http://gnufied.org

More information about the Backgroundrb-devel mailing list