[Xapian-discuss] Twisted + Xapian WriteableDatabase leaves db_lock file on exit.

Terry Jones tcj25 at cam.ac.uk
Wed May 3 15:43:38 BST 2006


Hi Jarrod

>>>>> "jarrod" == jarrod roberson <jarrod at vertigrated.com> writes:

jarrod> I have written a Twisted service to write to a xapian database.
jarrod> I am using WriteableDatabase using DB_CREATE_OR_OPEN.

jarrod> I am also using twistd and the application plumbing to start the
jarrod> server.

jarrod> I have tried everything but no matter how I stop the server I can't
jarrod> get it to shutdown xapian cleanly.

I'd like to know the answer, when you get it (assuming it's not just an old
version of Xapian).

Funnily enough, I ran into exactly the same problem last night, but in a
different context. I have some objects that have BSD databases open. I
tried to close the databases in a __del__() method when the objects are
destroyed. But I couldn't make it work. On closer inspection, it turned out
that __del__ wasn't even being called. Maybe that's your case too. In the
end I wrote my own close() method, which I now have to remember to call
before my objects go out of scope.

I don't know python very well. From what I read (google(__del__ not being
called) gets plenty of hits), there is no guarantee that __del__ will ever
be called and, it seems, even less guarantee if the interpreter itself is
about to go away. Maybe someone with more knowledge of python can clarify
this.

Regards,
Terry



More information about the Xapian-discuss mailing list