The underlying problem is bad unmarshalling of the Ferret::Document that 
gets sent to the DRb server.

In ferret_server.rb:

   rescue NoMethodError
     @logger.debug "no luck, trying to call class method instead"

Using rescue NoMethodError => e and then include e.message in the debug 
output, reveals:

undefined method `to_doc' for #<DRb::DRbUnknown:0x2a9808f3f0>

I'm pretty blank as to why Ferret::Document does not get properly 
unmarshalled on the initial request. If I change the add method to 
attempt a DRb reload in local_index.rb (line ~139):

def add(record)
   if record.is_a?(DRb::DRbUnknown)
     record = record.reload
     logger.warn("Reloaded DRb::DRbUnknown to #{record.class.name}")
   end

   record = record.to_doc unless Hash === record || Ferret::Document === 
record
   ferret_index << record
end

Then I do indeed get a Document instance back, ie. I have a work around.

But why does this work around work? Does the unmarshalling process occur 
before the relevant classes get loaded in the initial request?

I'll patch up my local AAF to use this work around, but as it does not 
solve the actual root problem, I guess it's not interesting as a patch 
submission.

Br,

Morten


_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to