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

On 5/3/06, Olly Betts olly@survex.com wrote:
On Tue, May 02, 2006 at 11:25:25PM -0400, jarrod roberson wrote:
xapian and xapian bindings 0.9.2 svn 6532
That's rather old - is this reproducible with 0.9.5?
It leaves the db_lock file everytime and I don't know what else it might
not
be cleaning up correctly either.
The db_lock file gets deleted when the C++ WritableDatabase destructor is called. So if it's not deleted, then the destructor isn't being called.
If you can reproduce with the latest release in a simple example (ideally without twisted being involved), I can try to investigate.
Cheers, Olly
yes, just upgraded and it does the same thing with 0.9.5
the problem is I can't reproduce it outside of Twisted.
all my command line tools that I have written ( all in Python ) that use the exact same code exit and close properly.

Here is the relevant output
cassandra:~/projects/wc/wfs/trunk/python/indexd
delve --version
delve - xapian-core 0.9.5 cassandra:~/projects/wc/wfs/trunk/python/indexd
whack /index/wfs/
cassandra:~/projects/wc/wfs/trunk/python/indexd
twistd -noy indexd.tac
2006/05/03 11:18 EDT [-] Log opened. 2006/05/03 11:18 EDT [-] twistd 2.2.0 (/usr/bin/python 2.4.1) starting up 2006/05/03 11:18 EDT [-] reactor class: twisted.internet.selectreactor.SelectReactor 2006/05/03 11:18 EDT [-] Loading indexd.tac... 2006/05/03 11:18 EDT [-] Loaded. 2006/05/03 11:18 EDT [-] __builtin__.IndexerFactoryFromService starting on 9000 2006/05/03 11:18 EDT [-] Starting factory <__builtin__.IndexerFactoryFromService instance at 0x5259e0> 2006/05/03 11:18 EDT [-] Start Xapian Index Service ^C2006/05/03 11:19 EDT [-] Received SIGINT, shutting down. 2006/05/03 11:19 EDT [-] Stopping Xapian Indexer Service 2006/05/03 11:19 EDT [-] (Port 9000 Closed) 2006/05/03 11:19 EDT [-] Stopping factory <__builtin__.IndexerFactoryFromService instance at 0x5259e0> 2006/05/03 11:19 EDT [-] Main loop terminated. 2006/05/03 11:19 EDT [-] Server Shut Down. cassandra:~/projects/wc/wfs/trunk/python/indexd
twistd -noy indexd.tac
2006/05/03 11:19 EDT [-] Log opened. 2006/05/03 11:19 EDT [-] twistd 2.2.0 (/usr/bin/python 2.4.1) starting up 2006/05/03 11:19 EDT [-] reactor class: twisted.internet.selectreactor.SelectReactor 2006/05/03 11:19 EDT [-] Loading indexd.tac... 2006/05/03 11:19 EDT [-] Traceback (most recent call last): 2006/05/03 11:19 EDT [-] File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/twisted/application/app.py", line 159, in getApplication 2006/05/03 11:19 EDT [-] application = service.loadApplication(filename, style, passphrase) 2006/05/03 11:19 EDT [-] File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/twisted/application/service.py", line 301, in loadApplication 2006/05/03 11:19 EDT [-] application = sob.loadValueFromFile(filename, 'application', passphrase) 2006/05/03 11:19 EDT [-] File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/twisted/persisted/sob.py", line 208, in loadValueFromFile 2006/05/03 11:19 EDT [-] exec fileObj in d, d 2006/05/03 11:19 EDT [-] File "indexd.tac", line 157, in ? 2006/05/03 11:19 EDT [-] i = XapianIndexerService('/wfs/', '/index/wfs/') 2006/05/03 11:19 EDT [-] File "indexd.tac", line 99, in __init__ 2006/05/03 11:19 EDT [-] self.db = xapian.WritableDatabase(indexRoot, xapian.DB_CREATE_OR_OPEN) 2006/05/03 11:19 EDT [-] File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/xapian.py", line 433, in __init__ 2006/05/03 11:19 EDT [-] _xapian.WritableDatabase_swiginit(self,_xapian.new_WritableDatabase(*args)) 2006/05/03 11:19 EDT [-] IOError: DatabaseLockError: Unable to acquire database write lock /index/wfs//db_lock 2006/05/03 11:19 EDT [-] Failed to load application: DatabaseLockError: Unable to acquire database write lock /index/wfs//db_lock 2006/05/03 11:19 EDT [-] Traceback (most recent call last): File "/usr/bin/twistd", line 25, in ? run() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/twisted/scripts/twistd.py", line 205, in run app.run(runApp, ServerOptions) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/twisted/application/app.py", line 278, in run runApp(config) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/twisted/scripts/twistd.py", line 195, in runApp application = app.getApplication(config, passphrase) --- <exception caught here> --- File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/twisted/application/app.py", line 159, in getApplication application = service.loadApplication(filename, style, passphrase) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/twisted/application/service.py", line 301, in loadApplication application = sob.loadValueFromFile(filename, 'application', passphrase) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/twisted/persisted/sob.py", line 208, in loadValueFromFile exec fileObj in d, d File "indexd.tac", line 157, in ? i = XapianIndexerService('/wfs/', '/index/wfs/') File "indexd.tac", line 99, in __init__ self.db = xapian.WritableDatabase(indexRoot, xapian.DB_CREATE_OR_OPEN) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/xapian.py", line 433, in __init__
_xapian.WritableDatabase_swiginit(self,_xapian.new_WritableDatabase(*args)) exceptions.IOError: DatabaseLockError: Unable to acquire database write lock /index/wfs//db_lock
Failed to load application: DatabaseLockError: Unable to acquire database write lock /index/wfs//db_lock 2006/05/03 11:19 EDT [-]
participants (1)
-
jarrod roberson