[Xapian-discuss] Re: 1.0 news, and a call for testing
Richard Boulton
richard at lemurconsulting.com
Sun May 6 12:06:20 BST 2007
Fabrice Colin wrote:
> On the same subject, I am experiencing a problem with locking.
> The sequence of events is as follows :
> 1. make sure no process uses the index I want to open (created with 0.9.x)
> and that neither "flintlock" nor "flicklock" exist.
> 2. create a WritableDatabase object with
> Xapian::WritableDatabase(path_to_the_index, Xapian::DB_CREATE_OR_OPEN)
> 3. catch DatabaseOpeningError exception, check that the message is about
> the
> version of Flint
> 4. try to overwrite the index with
> Xapian::WritableDatabase(path_to_the_index,
> Xapian::DB_CREATE_OR_OVERWRITE)
>
> At step 3, flintlock exists, thus preventing step 4 which results in a
> DatabaseLockError
> ("Unable to acquire database write lock on
> /home/fabrice/.pinot/daemon: already locked").
> Am I right in thinking that the lock file should be removed before
> DatabaseOpeningError
> is thrown ?
The lock file shouldn't be removed, because flint uses higher level
file-locking, rather than just testing for the presence of the lock
file. The lock on it should be released, though, when the Writable
database fails to be opened, so the overwrite step should work.
I'll try and write a test case to simulate this situation, and reproduce
it here.
--
Richard
More information about the Xapian-discuss
mailing list