ezmobius / nanite

self assembling fabric of ruby daemons
Apache License 2.0
735 stars 64 forks source link

Mapper unable to send requests from Merb (mongrel adapter) #3

Open highandwild opened 15 years ago

highandwild commented 15 years ago

I have started the mapper in config/init.rb but Nanite.request() simply returns false without any error message. The agent does not receive the request, either.

But it works fine if I test it with nanite-mapper !

Here's the code: http://gist.github.com/147641

ruby - 1.8.7 mongrel - 1.1.5 nanite - 0.4.1 (edge) amqp - 0.6.0 rabbitmq - 1.5.5 Arch - x64 OS - Cent OS 5.1 (virtual box)

highandwild commented 15 years ago

Update: I have no idea how (perhaps because I downgraded to ruby 1.8.6) but it seems to finally queue the job. Now the problem is that it just queues it and it never reaches the agent ! (I'm running it inside a merb console).

Nanite.mapper.job_warden.inspect shows this:

#<Nanite::JobWarden:0x2aaaabef7790 @serializer=# <Nanite::Serializer:0x2aaaabef8208 @serializers=[Marshal, JSON, YAML]>, @jobs={"b16084315b1e87436c37493e656f6f60"=>#<Nanite::Job:0x2aaaae71b370 @results={}, @intermediate_handler=nil, @request=#<Nanite::Request:0x2aaaae71b668 @persistent=false, @reply_to="mapper-d201c7294713d6f8d4ef1daa1cf793a6", @type="/title/search_by_title", @target=nil, @token="b16084315b1e87436c37493e656f6f60", @tags=[], @selector=:least_loaded, @payload={:term=>"Harry", :id=>82523}, @from="mapper-d201c7294713d6f8d4ef1daa1cf793a6">, @intermediate_state={}, @token="b16084315b1e87436c37493e656f6f60", @targets=["nanite-67a7b8cf51fe5131cc3096a6b951331a"], @completed=nil, @pending_keys=[]>}>

And yes, I am getting a hearbeat from the agents. Also, Nanite.mapper.cluster.nanites lists the nanites !

What am I doing wrong ?

highandwild commented 15 years ago

Tested it with sinatra (mongrel), and it works perfectly. Also upgraded to amqp edge. Still Zero luck with merb :( I also ran merb in debug mode but can't find anything amiss...