Hi David,
Appologies for the BCC, wasn't sure if you were subscribed to
rubyonrails-talk and I didn't want to cross-post the reply.
Before upgrading, I was running 0.11.0, but it appears as though the
gem update I did just now picked up a newer version (0.11.3). Does
this last one include all of the segfault+filenotfound fixes?
Before upgrading earlier today we hit a couple of bugs, all arising in
the same scenario: one process is creating many ActiveRecord models
which have acts_as_ferret, and so is updating the index, while the
rails application itself (so another process) is doing lots of
find_by_content(), the first of which take a very long time for some
reason (no idea why the finds would themselves cause a re-indexing to
happen, but they appear to).
The first time we ran our scenario, the process doing the creating
barfed due to a wierd lock error:
/usr/local/ruby-1.8.5/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/runner
.rb:45:
/usr/local/ruby-1.8.5/lib/ruby/gems/1.8/gems/ferret-0.11.0/lib/ferret/index.
rb:666:in `initialize': Lock Error occured at <except.c>:117 in xpop_context
(Ferret::Store:
:LockError)
Error occured in index.c:6044 - iw_open
Couldn't obtain write lock when opening IndexWriter
The second time it's the rails app itself that failed in the
controller action doing the find_by_contents, and it failed with a
different error: a file not found on a file that it was expecting to
find in the index directory.
I haven't yet been able to reproduce these problems with 0.11.3 (they
occured with 0.11.0), but I haven't tried very hard.
I guess my questions are:
1- with the latest version of ferret, 0.11.3, is concurrent access to
the index from multiple processes supposed to work?
2- with the latest version of ferret, 0.11.3, if i add a bunch of
stuff to the index, then do a find_by_contents which initially takes a
long while (because it causes an indexing), then later add more to the
index by creating acts_as_ferret models, should I expect the following
find_by_contents to take a long time, just like the initial one?
Right now it seems to be the case. I'm a little confused as to
where/when the reindexing is supposed to happen, and why it seems
index additions cause a reindexing by the following find_by_contents
call.
-Bosko