Jens,

Thanks for your response. I see errors in either the importer (batch)  
script or in the web app. The traces I happened to post previously  
were both from the batch script. Here are the relevant lines from a  
typical error found in the rails app's error log.

-Dave

ActionView::TemplateError (Lock Error occured at <except.c>:79 in xraise
Error occured in index.c:3089 - ir_is_latest
         Error trying to commit the index. Commit lock already obtained

) on line #2 of app/views/messages/_message_tables_simple.rhtml:
1: <% if search_term %>
2: <% messages = Message.find_by_search_term(params[:search_term],  
session[:timezone_offset]) %>
3: <% elsif current_filter("filter_name") %>
4: <% messages = Message.find_by_current_filter(session 
["current_filter"], nil, nil, session[:timezone_offset], params 
[:days_ago], params[:alldays]) %>
5: <% elsif params["listid"] %>

     /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.1/lib/ferret/ 
index.rb:537:in `latest?'
     /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.1/lib/ferret/ 
index.rb:537:in `ensure_reader_open'
     /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.1/lib/ferret/ 
index.rb:264:in `[]'
     /usr/local/lib/ruby/1.8/monitor.rb:229:in `synchronize'
     /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.1/lib/ferret/ 
index.rb:263:in `[]'
     #{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/ 
acts_as_ferret.rb:486:in `find_id_by_contents'
     /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.1/lib/ferret/ 
index.rb:252:in `search_each'
     /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.1/lib/ferret/ 
index.rb:251:in `search_each'
     /usr/local/lib/ruby/1.8/monitor.rb:229:in `synchronize'
     /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.1/lib/ferret/ 
index.rb:247:in `search_each'
     #{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/ 
acts_as_ferret.rb:484:in `find_id_by_contents'
     #{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/ 
acts_as_ferret.rb:344:in `find_by_contents'
     #{RAILS_ROOT}/app/models/message.rb:87:in `find_by_search_term'


On Aug 27, 2006, at 4:58 AM, Jens Kraemer wrote:

> On Sat, Aug 26, 2006 at 09:08:46AM -0700, David Ranney wrote:
>> Hello,
>>
>> I'm using acts_as_ferret with a single model class in my rails app. I
>> have a cron job that batch-loads several hundred objects of this
>> class at a time. While the batch job is running, attempting to run a
>> search from the web app results in a lock error of one type or
>> another. So far I've seen the two types of errors below. I see in the
>> archives several messages suggesting that using :auto_flush => true
>> should resolve locking problems. Looking at the acts_as_ferret code
>> suggests to me that :auto_flush => true is being used, but I'm not
>> 100% sure. Can someone shed some light on this for me?
>
> Yes, aaf uses auto_flush. In theory, searching the index should not
> result in any write access to the index (unless the index doesn't  
> exist
> yet, in that case aaf tries to rebuild it before running the search)
>
> Where do you see these errors ? The importer script or the web app ?
>
> The second stack trace is strange, as the simple initialization of the
> Index instance results in a locking error.
>
>
> Jens
>>
>> I'm using ferret 0.10.1 and acts_as_ferret from svn trunk rev 84.
>>
>> Thanks,
>>
>> -Dave
>>
>> /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.1/lib/ferret/index.rb:
>> 409:in `close': Lock Error occured at <except.c>:79 in xraise
>> (Ferret::Store::Lock::LockError)
>> Error occured in index.c:5237 - iw_flush_ram_segment
>>          Couldn't obtain commit lock to write segments file
>>
>>          from /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.1/lib/
>> ferret/index.rb:409:in `flush'
>>          from /usr/local/lib/ruby/1.8/monitor.rb:229:in `synchronize'
>>          from /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.1/lib/
>> ferret/index.rb:406:in `flush'
>>          from /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.1/lib/
>> ferret/index.rb:214:in `<<'
>>          from /usr/local/lib/ruby/1.8/monitor.rb:229:in `synchronize'
>>          from /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.1/lib/
>> ferret/index.rb:186:in `<<'
>>          from /home/digest/digest.sialia.com/helper_scripts/../
>> config/../vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:567:in
>> `ferret_create'
>>          from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/
>> lib/active_record/callbacks.rb:344:in `callback'
>>           ... 11 levels...
>>          from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/
>> lib/active_record/transactions.rb:126:in `save'
>>
>>
>> /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.1/lib/ferret/index.rb:
>> 98:in `initialize': Lock Error occured at <except.c>:103 in
>> xpop_context (Ferret::Store::Lock::LockError)
>> Error occured in index.c:5371 - iw_open
>>          Couldn't obtain write lock when opening IndexWriter
>>
>>          from /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.1/lib/
>> ferret/index.rb:98:in `initialize'
>>          from /usr/local/lib/ruby/1.8/monitor.rb:229:in `synchronize'
>>          from /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.1/lib/
>> ferret/index.rb:96:in `initialize'
>>          from /home/digest/digest.sialia.com/helper_scripts/../
>> config/../vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:320:in
>> `create_index_instance'
>>          from /home/digest/digest.sialia.com/helper_scripts/../
>> config/../vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:312:in
>> `ferret_index'
>>          from /home/digest/digest.sialia.com/helper_scripts/../
>> config/../vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:567:in
>> `ferret_create'
>>          from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/
>> lib/active_record/callbacks.rb:344:in `callback'
>>          from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/
>> lib/active_record/callbacks.rb:341:in `callback'
>>           ... 10 levels...
>>          from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/
>> lib/active_record/transactions.rb:126:in `save'
>>
>> _______________________________________________
>> Ferret-talk mailing list
>> [email protected]
>> http://rubyforge.org/mailman/listinfo/ferret-talk
>
> -- 
> webit! Gesellschaft für neue Medien mbH          www.webit.de
> Dipl.-Wirtschaftsingenieur Jens Krämer       [EMAIL PROTECTED]
> Schnorrstraße 76                         Tel +49 351 46766  0
> D-01069 Dresden                          Fax +49 351 46766 66
> _______________________________________________
> Ferret-talk mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/ferret-talk

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

Reply via email to