[Backgroundrb-devel] Cannot connect when spawning new workers on demand

Ger Apeldoorn gapeldoorn at wehkamp.nl
Tue Jan 22 05:03:11 EST 2008


Hi!

Thanks a lot for your reply!

> Did you check backgroundrb_debug.log ?
> You can turn on debugging to foreground with:
> 
> :log: foreground

Where should I put :log: foreground?

Anyway, this comes from log/backgroundrb_debug.log:

--------------------%<--------------------

$ tail -f log/backgroundrb_debug.log 
000000073:      type:start_worker:
                                   worker:remote_command_worker:

job_key"

server06
{:type=>:start_worker, :worker=>:remote_command_worker, :job_key=>"server06"}
000000115{
:       type:
             do_work:
                     worker:remote_command_worker:     data{:
                                                              command"
megacommandheresvr"
server06:
        job_key:worker_method;
{:type=>:do_work, :worker_method=>:do_work, :data=>{:svr=>"server06", :command=>"megacommandhere"}, :worker=>:remote_command_worker, :job_key=>"server06"}
000000073:      type:start_worker:
                                   worker:remote_command_worker:

job_key"

server12
{:type=>:start_worker, :worker=>:remote_command_worker, :job_key=>"server12"}
000000115{
:       type:
             do_work:
                     worker:remote_command_worker:     data{:
                                                              command"
megacommandheresvr"
server12:
        job_key:worker_method;
{:type=>:do_work, :worker_method=>:do_work, :data=>{:svr=>"server12", :command=>"megacommandhere"}, :worker=>:remote_command_worker, :job_key=>"server12"}

--------------------%<--------------------

> 
> option to further debug this. Something is killing BackgrounDRb master
> process. Can you sync with trunk and enable foreground logging and
> check on this?

Is there an easy way to update a plugin after it's been installed
besides removing it and checking it out again?

> Also, if possible, can we see your worker code?

Here's my worker:

class RemoteCommandWorker < BackgrounDRb::MetaWorker
  set_worker_name :remote_command_worker
  set_no_auto_load :true

  def create(args = nil)
    register_status("processing")
  end

  def do_work(args = nil)
    result = String.new
    result = "Result for #{args[:command]}:\n #{%
x[running_a_shell_script_here]}"
    register_status(result)
  end
end

Thanks,
Ger.


More information about the Backgroundrb-devel mailing list