[Xapian-discuss] xapian-tcpsrv php in real fastcgi loop

Martin Regner mregner at larkos.de
Sun Mar 21 10:57:03 GMT 2010


Well, it's working mostly with two tcpsrv Instances.

Now i randomly get an DatabaseLockError when one of the loops is trying to 
index something (on the writing instance). I try to solve this by implementing 
a few retries after some microseconds. But this is like betting on a lucky 
chance. Is this a problem inside the tcpsrv or is it (like before) the not yet 
realy closed client connection of the loop/thread?

Doeas anyone have another approach for multiple clients trying to write 
simultanously?

May it's possible that xapian-tcpsrv is buffering the write requests until the 
lock is removed (i know this is much more complicated than it sounds).

Greetings so far
DonMartio

Am Samstag, 20. März 2010 15:58:22 schrieb Martin Regner:
> Ok, thank you very much. I try the two instances as a more stable variant.
> 
> Secons step is to check 1.1.0 (have to make shure that build on our Suse
> based live system).
> 
> How stable is xapian-1.1.0? Are there big issues i should know of?
> 
> Thank you again for the quick reply. I love open source.
> 
> Greetings DonMartio
> 
> Am Samstag, 20. März 2010 15:31:37 schrieb Olly Betts:
> > On Fri, Mar 19, 2010 at 07:25:35PM +0100, Martin Regner wrote:
> > > First, this is a connection tried to open with Xapian::remote_open. So
> > > i think it should'nt create a write lock. Otherwise, i started
> > > xapian-tcpsrv with -- writable, do i have to start to instances on the
> > > same directory, one writable and one not?
> > 
> > Yes, you do for Xapian 1.0.x.
> > 
> > Xapian 1.1.0 fixed this:
> > 
> > http://trac.xapian.org/ticket/145
> > 
> > > Second, if i understand the examples right i have to unset the database
> > > object to get the lock released. But i don't want to close the
> > > connection. I Just want to release the lock if possible. Is there any
> > > convenient way to let any lock go if everything is done in a process?
> > 
> > Again, not in 1.0.x.  It can be a problem as it is quite easy to
> > inadvertently keep a reference to the database (either through another
> > Xapian object, or with some scripting languages because there's a garbage
> > collection phase which needs to run before the C++ destructor actually
> > gets called).
> > 
> > 1.1.0 added a Database::close() method to close a database right away,
> > and release any lock and close any network connections.
> > 
> > > Third, if there is a lock why is there a exception thrown? Wouldn't it
> > > be better to wait for the lock a well defined time similar to database
> > > locks for example?
> > 
> > Sometimes you don't want to wait, but it would be useful to be able to
> > specify that you want the attempt to block until it can get a write lock.
> > There's already an open ticket for this:
> > 
> > http://trac.xapian.org/ticket/275
> > 
> > Cheers,
> > 
> >     Olly
> 
> _______________________________________________
> Xapian-discuss mailing list
> Xapian-discuss at lists.xapian.org
> http://lists.xapian.org/mailman/listinfo/xapian-discuss




More information about the Xapian-discuss mailing list