To edit pages or tickets please login with username/password: aaf/aaf

Ticket #149 (closed enhancement: fixed)

Opened 1 year ago

Last modified 5 months ago

handle failed DRb requests in RemoteIndex

Reported by: jk Assigned to: jk
Priority: major Milestone: 0.5
Component: 0plugin Version:
Keywords: Cc: j@jjb.cc

Description

failing indexing because of a missing DRb server should not result in raised Exceptions . Instead log the error and go on.

Change History

07/16/07 11:48:30 changed by jk

  • status changed from new to assigned.
  • milestone changed from 0.4.1 to 0.5.

02/01/08 01:30:37 changed by aaf

Ideas from the mailing list:

Julio Cesar Ody says:

## On ACTS_AS_FERRET_GEM_ROOT/lib/index.rb

def ferret_create
  if ferret_enabled?
    logger.debug "ferret_create/update: #{self.class.name} : #{self.id}"
    self.class.aaf_index << self
  else
    ferret_enable if @ferret_disabled == :once
  end
    true # signal success to AR
end

## Try wrapping "aaf_index<<" like this

begin
  self.class.aaf_index << self
rescue Exception => e
  logger.warn "Error creating/updating document:
#{e.inspect}\n#{e.backtrace.join("\n\t")}"
end

## Mind I'm just reading the source and writing the code here straight
## away. In the event of my theory being right, this would gracefully
## handle exceptions related to adding an entry to the index by dropping
## a warning in the AAF log file and moving on.

## I think this could be an optional in config/initializers (Rails 2.0)
## perhaps, as in

config.aaf.exception_on_save = true

## IMHO, of course.

Peter Jones says:

## If you're still looking at how to solve this, here is what I did.   
## This is just a hack, but I didn't really have a choice, this coupling  
## was killing my entire application stack.

--- act_methods.rb      (revision 1534)
+++ act_methods.rb      (working copy)
@@ -185,9 +185,10 @@
        end
        logger.info "default field list: #{aaf_configuration[:ferret] 
[:default_field].inspect}"

-      if options[:remote]
-        aaf_index.ensure_index_exists
-      end
+      # FIXME fix and send a patch to the AAF team
+      # if options[:remote]
+      #   aaf_index.ensure_index_exists
+      # end
      end

02/01/08 01:36:44 changed by aaf

  • cc set to j@jjb.cc.

02/02/08 16:40:03 changed by jk

  • status changed from assigned to closed.
  • resolution set to fixed.

fixed in trunk. Aaf now by default handles any DRb connection errors - it logs a warning and returns false or empty SearchResults? where suitable.

Use the :raise_drb_errors option with a true value to restore the old behaviour.

To edit pages or tickets please login with username/password: aaf/aaf