[Backgroundrb-devel] querying status of worker with job_key

Ivan S. Manida Ivan.Manida at Sun.COM
Tue Dec 18 11:50:54 EST 2007


Reynard wrote:
> Is it possible to start a worker with job_key and then ask_status
of that
> specific worker with the job_key?
>
> MiddleMan.ask_work(:worker => :auth_worker, :job_key=>'1',
> :worker_method => :auth)
>
> and then
>
> MiddleMan.ask_status(:worker => :auth_worker, :job_key=>'1')


You should use register_status() from your worker - this works for
me (using job_key as you describe). Of course, code is not yet well
tested, but at least the status part is working fine :)

I have another problem - meta_pimp dies sometimes, in about 50% of
the jobs. With the following stack trace. Worker is trivial but is
using job_key. Looking through the code, it seems that connection is
dropped while working, but which one - master <-> worker?

/var/apps/ror_trunk/vendor/plugins/backgroundrb/framework/meta_pimp.rb:58:in
`process_response': undefined method `instance' for nil:NilClass
(NoMethodError)
        from
/var/apps/ror_trunk/vendor/plugins/backgroundrb/framework/meta_pimp.rb:29:in
`handle_object'
        from
/var/apps/ror_trunk/vendor/plugins/backgroundrb/framework/meta_pimp.rb:20:in
`receive_data'
        from
/var/apps/ror_trunk/vendor/plugins/backgroundrb/lib/../framework/bin_parser.rb:29:in
`call'
        from
/var/apps/ror_trunk/vendor/plugins/backgroundrb/lib/../framework/bin_parser.rb:29:in
`extract'
        from
/var/apps/ror_trunk/vendor/plugins/backgroundrb/lib/../framework/bin_parser.rb:42:in
`extract'
        from
/var/apps/ror_trunk/vendor/plugins/backgroundrb/framework/meta_pimp.rb:18:in
`receive_data'
        from
/var/apps/ror_trunk/vendor/plugins/backgroundrb/framework/packet_master.rb:63:in
`handle_internal_messages'
        from
/var/apps/ror_trunk/vendor/plugins/backgroundrb/framework/core.rb:154:in
`start_reactor'
        from
/var/apps/ror_trunk/vendor/plugins/backgroundrb/framework/core.rb:152:in
`each'
        from
/var/apps/ror_trunk/vendor/plugins/backgroundrb/framework/core.rb:152:in
`start_reactor'
        from
/var/apps/ror_trunk/vendor/plugins/backgroundrb/framework/core.rb:143:in
`loop'
        from
/var/apps/ror_trunk/vendor/plugins/backgroundrb/framework/core.rb:143:in
`start_reactor'
        from
/var/apps/ror_trunk/vendor/plugins/backgroundrb/framework/packet_master.rb:20:in
`run'
        from
/var/apps/ror_trunk/vendor/plugins/backgroundrb/server/master_worker.rb:133:in
`initialize'
        from script/backgroundrb:37:in `new'
        from script/backgroundrb:37
Some read error
Some read error
Some read error
Some read error
Some read error
Some read error
Some read error
Some read error
Some read error
Some read error
Some read error
Some read error
Some read error




More information about the Backgroundrb-devel mailing list