[Xapian-devel] multiple writers and remotetcp backends

Olly Betts olly at survex.com
Tue May 1 12:49:27 BST 2007


On Tue, May 01, 2007 at 12:36:54PM +1000, Mark Hammond wrote:
> The problem is that a xapian tcp-server in 'writable' mode makes no attempt
> to ensure only one 'active' connection at a time is trying to modify the
> database.  If multiple connections are made to a writable server, the
> behaviour is undefined (or even it is was defined, it is unlikely to be
> defined in a way that would make it useful).

I'd not appreciated this happened from the previous discussion - this
is certainly a bug.  I understood the issue was just that of trying to
marshal multiple processes wanting to write to the same remote server
in a sane way.

Looking at the code, I believe it's also wrong that we open the database
and then fork multiple processes which can make use of it, even for a
read-only Database.  We certainly don't promise that you can use the same
Xapian object from different threads.  I think similar rules ought to
apply over fork.

But this matters much more for writers - with the current backends, it
happens to work OK for readers I think.

So we should probably leave the reader issue for now, as it can be fixed
without API or ABI changes, but fix the writer issue.

Cheers,
    Olly



More information about the Xapian-devel mailing list