Opened 8 years ago

Closed 8 years ago

#746 closed defect (fixed)

Locking Behavior Documentation Out of Date

Reported by: tim Owned by: Olly Betts
Priority: normal Milestone:
Component: Documentation Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: All

Description

Within the databases description of locking, the following text is provided:

With the disk-based Xapian backends, when a database is opened for writing, a lock is obtained on the database to ensure that no further writers are opened concurrently. This lock will be released when the database writer is closed (or automatically if the writer process dies).

One unusual feature of Xapian’s locking mechanism (at least on POSIX operating systems) is that Xapian forks a subprocess to hold the lock, rather than holding it in the main process. This is to avoid the lock being accidentally released due to the slightly unhelpful semantics of fcntl locks.

Change History (1)

comment:1 by Olly Betts, 8 years ago

Resolution: fixed
Status: newclosed

I've pushed a fix - new wording is:

One unusual feature of Xapian's locking mechanism (at least on POSIX
operating systems other than Linux) is that Xapian forks a subprocess to hold
the lock, rather than holding it in the main process.  This is to avoid the
lock being accidentally released due to the slightly unhelpful semantics of
fcntl locks.  Linux kernel 3.15 added new OFD fcntl locks which have more
helpful semantics which Xapian uses in preference, avoiding the need to fork
a subprocess to hold the lock.

Thanks for reporting.

Note: See TracTickets for help on using tickets.