Twisted Sumo 2006-02-12<br><br>xapian and xapian bindings 0.9.2 svn 6532<br clear="all"><br>I have written a Twisted service to write to a xapian database.<br>I am using WriteableDatabase using DB_CREATE_OR_OPEN.<br><br>I am also using twistd and the application plumbing to start the server.
<br><br>I have tried everything but no matter how I stop the server I can't get it to shutdown xapian cleanly.<br><br>I have implemented stopService() on my service and do a .flush() and have even tried setting the db instance to None
<br>and tried using del self.db as well.<br><br>I even added a reactor.addSystemEventTrigger() and tried &quot;before&quot;, &quot;during&quot; and &quot;after&quot; &quot;shutdown&quot; and nothing<br>seems to work.<br><br>
I stop the service with CTRL-C, kill -TERM `cat twistd.pid' and just plain kill 'cat twistd.pid'<br><br>It leaves the db_lock file everytime and I don't know what else it might not be cleaning up correctly either.<br>
<br>Has anyone gotten a WritableDatabase to work with Twisted? <br>If so, how do I stop Twisted so it will shutdown xapian cleanly?<br><br><br>