[Backgroundrb-devel] Invalid worker with name [worker name] and key

Samer Masry enzodm at gmail.com
Tue Nov 18 12:54:01 EST 2008


By default when you start the server it finds all of the workers and inserts
one in.

Make sure when you create a new worker with a key you are using the
new_worker method
MiddleMan.new_worker(:worker => #{worker_name}, :worker_key =>
#{worker_key})

You'll then be able to access the worker by the key.

PS.  in the console use MiddleMan.all_worker_info to get a list of all the
worker objects.  Once you use the new_worker method you will see the newly
created worker with the key specified.


On Tue, Nov 18, 2008 at 12:13 AM, Ramon Tayag <ramon.tayag at gmail.com> wrote:

> Hey everyone.  I started to wonder why no mail was being sent from my
> app and I checked the log and saw this:
>
> I haven't upgraded my backgroundrb so I can't/shouldn't be a version
> error.  I decided to restart my cluster (mongrels and backgroundrb
> server) and tried to send again.  It worked.  What causes this
> problem?  And what can I do so that I'll be notified when this problem
> arises?
>
> Invalid worker with name mail_worker and key
>
> /usr/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_connection.rb:52:in
> `ask_worker'
>
> /home/ramon/my-app/current/vendor/plugins/backgroundrb/server/lib/master_worker.rb:103:in
> `async_method_invoke'
>
> /home/ramon/my-app/current/vendor/plugins/backgroundrb/server/lib/master_worker.rb:37:in
> `receive_data'
> /usr/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_parser.rb:44:in
> `extract'
> /usr/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_parser.rb:26:in
> `loop'
> /usr/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_parser.rb:26:in
> `extract'
>
> /home/ramon/my-app/current/vendor/plugins/backgroundrb/server/lib/master_worker.rb:32:in
> `receive_data'
> /usr/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:232:in
> `read_external_socket'
> /usr/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:222:in
> `handle_external_messages'
> /usr/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:196:in
> `handle_read_event'
> /usr/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:192:in
> `each'
> /usr/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:192:in
> `handle_read_event'
> /usr/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:146:in
> `start_reactor'
> /usr/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:139:in
> `loop'
> /usr/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_core.rb:139:in
> `start_reactor'
> /usr/lib/ruby/gems/1.8/gems/packet-0.1.13/lib/packet/packet_master.rb:21:in
> `run'
>
> /home/ramon/my-app/current/vendor/plugins/backgroundrb/server/lib/master_proxy.rb:14:in
> `initialize'
> /home/ramon/my-app/current/script/backgroundrb:47:in `new'
> /home/ramon/my-app/current/script/backgroundrb:47
> Client disconected
>
> Thanks,
> Ramon Tayag
> _______________________________________________
> Backgroundrb-devel mailing list
> Backgroundrb-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/backgroundrb-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20081118/537df5bb/attachment.html>


More information about the Backgroundrb-devel mailing list