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

Reply via email to