[Xapian-discuss] Re: 1.0 news, and a call for testing

Richard Boulton richard at lemurconsulting.com
Mon May 7 17:04:35 BST 2007


Fabrice Colin wrote:
> As for the locking problem I described, I quickly hacked omindex to try
> and overwrite the database if a format error is detected :
...
> Is this enough to point in the right direction ? Let me know if you need 
> more
> information.

Yes, that helped a lot, thanks.  I've now reproduced this and have a fix 
- I just need to get a regression test written, and then I'll commit it. 
  The problem was due to a lock which is obtained in the constructor not 
being freed when an exception is thrown: normally it would be unlocked 
by the destructor, but this doesn't get called if the constructor fails.

However, I would suggest that when you handle this in your application, 
you delete (or move to a backup location) the old database before 
creating the new one, rather than relying on the overwrite mechanism to 
work.  It should work in this case, but I'd be uncomfortable with 
guaranteeing that it will always be able to cope.

-- 
Richard



More information about the Xapian-discuss mailing list