[Backgroundrb-devel] Zombies?

Matt White stockliasteroid at gmail.com
Wed Nov 22 17:25:24 EST 2006


Hey all,

Quick question about handling completed workers...

Most of my workers are one-offs that just let me spin off a long-running
file transfer process and then they just need to self-destruct when
completed. Thus, at the end of my do_work, I just call self.delete to (in
theory) self-destruct.

However, while checking the jobs.size from the console, I've noticed that
this doesn't seem to be working. Further, by grabbing the worker keys via
jobs.keys, I try to manually call delete_worker to kill them off, and I get
a RuntimeError "not beating" from Slave. However, when I call
jobs[key].shutdown? to see if the job is dead, it returns false, indicating
the the job isn't "shut down". So, I can't seem to have the workers
self-destruct, and I can't kill them from the MiddleMan, either. The only
solution seems to be to call shutdown({:quiet => true}) to suppress errors
from slave. However, I don't know if this will actually succeed in whacking
the process...

Calling gc! basically results in the same behavior, because it tries to call
delete_worker and I get the same "not beating" error.

If this is a bug, I'll put it in trac, but it seems like I must be doing
something wrong.

Thanks!

-- 
Thermal Creative
http://blog.thermalcreative.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20061123/f613ecac/attachment.html 


More information about the Backgroundrb-devel mailing list