On Tue, 2008-03-04 at 13:48 +0000, Rue Turner wrote:> IT all seems fine till I ask it to query the worker for anything
> directly. Is packet broken? should we be using a specific version with
> backgroundrb?
>
> Console:
>
> >> MiddleMan.query_all_workers
> {:type=>:all_worker_status}
> => {:street_worker=>"foo", :log_worker=>nil}
>
> that seems fine, then:
>
> >> MiddleMan.ask_status(:worker_name => :street_worker)
> {:type=>:get_status, :worker_name=>:street_worker}
> => nil
>
> and the server barfs. The project is brand new and has nothing other
> than this worker in it. The worker itself _only_ registers a status -
> nothing else, no methods.
>
> Here''s the log:
>
> /.../vendor/plugins/backgroundrb/server/lib/master_worker.rb:119:in
> `process_status'': You have a nil object when you didn''t
expect it!
> (NoMethodError)
> The error occurred while evaluating nil.to_sym
> from /.../vendor/plugins/backgroundrb/server/lib/master_worker.rb:36:in
`receive_data''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_parser.rb:29:in
`call''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_parser.rb:29:in
`extract''
>
> from /.../vendor/plugins/backgroundrb/server/lib/master_worker.rb:31:in
`receive_data''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:212:in
`read_external_socket''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:204:in
`handle_external_messages''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:178:in
`handle_read_event''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:174:in
`each''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:174:in
`handle_read_event''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:130:in
`start_reactor''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:124:in
`loop''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:124:in
`start_reactor''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:21:in
`run''
>
> from /.../vendor/plugins/backgroundrb/server/lib/master_worker.rb:166:in
`initialize''
> from script/backgroundrb:56:in `new''
> from script/backgroundrb:56
> /usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_nbio.rb:25:in
`read_data'': Packet::DisconnectError (Packet::DisconnectError)
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_worker.rb:46:in
`handle_internal_messages''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:176:in
`handle_read_event''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:174:in
`each''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:174:in
`handle_read_event''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:130:in
`start_reactor''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:124:in
`loop''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:124:in
`start_reactor''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_worker.rb:20:in
`start_worker''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:133:in
`fork_and_load''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:96:in
`load_workers''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:91:in
`each''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:91:in
`load_workers''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:20:in
`run''
>
> from /.../vendor/plugins/backgroundrb/server/lib/master_worker.rb:166:in
`initialize''
> from script/backgroundrb:56:in `new''
> from script/backgroundrb:56
> /usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_nbio.rb:25:in
`read_data'': Packet::DisconnectError (Packet::DisconnectError)
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_worker.rb:46:in
`handle_internal_messages''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:176:in
`handle_read_event''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:174:in
`each''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:174:in
`handle_read_event''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:130:in
`start_reactor''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:124:in
`loop''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:124:in
`start_reactor''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_worker.rb:20:in
`start_worker''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:133:in
`fork_and_load''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:108:in
`start_worker''
>
> from /.../vendor/plugins/backgroundrb/server/lib/master_worker.rb:169:in
`initialize''
>
> from
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:19:in
`run''
>
> from /.../vendor/plugins/backgroundrb/server/lib/master_worker.rb:166:in
`initialize''
> from script/backgroundrb:56:in `new''
> from script/backgroundrb:56
>
>
>From where did you get: MiddleMan.ask_status(:worker_name
=> :street_worker) ?
It should be:
MiddleMan.ask_status(:worker => :street_worker) or
MiddleMan.worker(:street_worker).ask_status
Also, file a bug report nonetheless, since server shouldn''t crash
anyways.