[Xapian-discuss] xapian-tcpsrv throws "Error reading block" exceptions

Olly Betts olly at survex.com
Mon Jun 19 16:36:43 BST 2006


On Mon, Jun 19, 2006 at 10:56:53AM -0400, Rocco Caputo wrote:
> The problem seems to be related to sharing a single open database
> across multiple child processes.  Adding a db.reopen() call to the
> start of TcpServer::run_once() seems to have resolved the exception. 
> I've been running ten concurrent clients overnight, and none of the
> 1,355,000 queries have encountered the "Error reading block ###"
> exception.

Oh dear me, it opens the database and then forks for each request.  We
don't guarantee you can use the same Database object from different
threads, let alone different processes!

I suspect calling reopen as you suggest will actually make this work
but we shouldn't be doing it like this really.  I'll look into fixing
this better.

The testsuite doesn't exercise this case - it uses the oneshot mode.
There's a lesson there somewhere...

Cheers,
    Olly



More information about the Xapian-discuss mailing list