Ticket #38 (closed defect: wontfix)

Opened 2 years ago

Last modified 2 years ago

DatabaseLockError with xapian/mod_python

Reported by: Dirk Datzert <dummy@habmalnefrage.de> Assigned to: athomas
Priority: major Component: pyndexter
Severity: normal Keywords: xapian TracRepoSearchPlugin
Cc:

Description

Hi,

I have trouble with xapian0.9.9 and mod_pyhton3.2.10/pyhton2.5. Do you have experienace with the following traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 387, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 183, in dispatch
    req.perm = PermissionCache(self.env, req.authname)
  File "/usr/lib/python2.5/site-packages/trac/perm.py", line 263, in __init__
    self.perms = PermissionSystem(env).get_user_permissions(username)
  File "/usr/lib/python2.5/site-packages/trac/perm.py", line 213, in get_user_permissions
    for requestor in self.requestors:
  File "/usr/lib/python2.5/site-packages/trac/core.py", line 55, in extensions
    return filter(None, [component.compmgr[cls] for cls in extensions])
  File "/usr/lib/python2.5/site-packages/trac/core.py", line 179, in __getitem__
    component = cls(self)
  File "/usr/lib/python2.5/site-packages/trac/core.py", line 98, in maybe_init
    init(self)
  File "build/bdist.linux-i686/egg/tracreposearch/__init__.py", line 134, in __init__
  File "/usr/lib/python2.5/site-packages/pyndexter/__init__.py", line 578, in __init__
    self.indexer = self._load_plugin('indexer', indexer, indexer_args)
  File "/usr/lib/python2.5/site-packages/pyndexter/__init__.py", line 706, in _load_plugin
    return indexer_factory(framework=self, **uri.query)
  File "/usr/lib/python2.5/site-packages/pyndexter/__init__.py", line 564, in __call__
    return self.plugin(**args)
  File "/usr/lib/python2.5/site-packages/pyndexter/indexers/xapian.py", line 37, in __init__
    self.db = xapian.flint_open(self.xapian_path, xapian.DB_CREATE_OR_OPEN)
IOError: DatabaseLockError: Unable to acquire database write lock on /var/tmp/projenv/db/reposearch/xapian.db

A second error toggles in here

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 387, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.5/site-packages/trac/Search.py", line 181, in process_request
    results += list(source.get_search_results(req, terms, filters))
  File "build/bdist.linux-i686/egg/tracreposearch/__init__.py", line 162, in get_search_results
AttributeError: 'TracRepoSearchPlugin' object has no attribute 'framework'

Regards, Dirk

Attachments

pyndexter-xapian-flintlock.diff (0.7 kB) - added by Dirk Datzert <dummy@habmalnefrage.de> on 01/31/07 11:31:05.
My fix for pyndexter/indexer/xapian.py

Change History

01/31/07 11:30:21 changed by Dirk Datzert <dummy@habmalnefrage.de>

Hi read the xapian mailing lists and found that this is a xapian issue under python binding.

I fixed in indexer/xapian to remove the flintlock-file.

01/31/07 11:31:05 changed by Dirk Datzert <dummy@habmalnefrage.de>

  • attachment pyndexter-xapian-flintlock.diff added.

My fix for pyndexter/indexer/xapian.py

(follow-up: ↓ 4 ) 02/04/07 22:34:11 changed by athomas

  • status changed from new to assigned.

Dirk, I am not able to replicate this with the 0.9.9 bindings and Xapian 0.9.9. The locking exception is only raised if an indexer has the database open.

Overriding the default locking behaviour by erasing the lock file would be a bad idea, as the database could be legitimately locked.

Also, are you sure the lock file is called flintlock? In my version of 0.9.9 the lock file is called flicklock, which is a known issue in Xapian.

02/04/07 22:34:40 changed by athomas

PS. Thanks for testing out repo-search, much appreciated :)

(in reply to: ↑ 2 ) 02/05/07 09:00:36 changed by Dirk Datzert <dummy@habmalnefrage.de>

Replying to athomas:

Dirk, I am not able to replicate this with the 0.9.9 bindings and Xapian 0.9.9. The locking exception is only raised if an indexer has the database open.

I do an update-index and the lock-file is still there afterwards. Do you have the same python 2.5 version ?

Overriding the default locking behaviour by erasing the lock file would be a bad idea, as the database could be legitimately locked.

Yes, I know, but it was the only way to fix it :(

Also, are you sure the lock file is called flintlock? In my version of 0.9.9 the lock file is called flicklock, which is a known issue in Xapian.

Yes, correct. I have a xapian-0.9.9 version which has fixed this issue already.

02/14/07 07:13:50 changed by athomas

  • status changed from assigned to closed.
  • resolution set to wontfix.

I'm going to close this, as I think locking is outside the scope of Pyndexter (let the application handle it). That doesn't mean I won't fix this though - I'll implement external locking in reposearch :)


Add/Change #38 (DatabaseLockError with xapian/mod_python)




Change Properties
Action