Description

MoinMoin.caching locking did not really work.

As it uses "Lazy Locks" and utilizes some POSIX fs semantics, real locks were only used on win32 (or rather: not used, because the code was broken).

Thus, the bug was likely only on win32 and not on POSIX OSes (Linux & Co).

Steps to reproduce

TBD

Component selection

Details

MoinMoin Version

1.8 since cs 6d2f6f954c08, 1.7 since cs b13a58a18dac, about July 2008

OS and Version

win32

Python Version

any

Discussion

The patch below needs some testing:

Nope, still there. Slightly different, though.

[Sat Aug 29 19:39:42 2009] [error] 2009-08-29 19:39:42,779 MoinMoin.caching ERROR Can't open cache file C:\\WEB\\wiki1\\wiki\\data\\cache\\__common__\\session\\auu4lcdkm7y7drd_9b24tr38lpmundl1 [[Errno 2] No such file or directory: 'C:\\\\WEB\\\\wiki1\\\\wiki\\\\data\\\\cache\\\\__common__\\\\session\\\\auu4lcdkm7y7drd_9b24tr38lpmundl1']

I suggest that one of the developer install MSWin on a machine, makes a page with a lot of photo attachement and try it out. The locking/caching code is severly broken on win32. Has been for a long time. /JanC

(!) That's just a cosmetic problem. It logs that error if the file does not exist. Will be fixed soon to only log failing open for write mode. So "still there" means exactly what, aisde from the log entry? -- ThomasWaldmann 2009-08-29 18:52:54

"Still there" means that attachments are not allways served. Sorry...

[Sat Aug 29 19:39:43 2009] [error] 2009-08-29 19:39:43,638 MoinMoin.failure ERROR An exception occurred, URI was "/wiki/images?action=AttachFile&do=get&target=img_1077.jpg".
[Sat Aug 29 19:39:43 2009] [error] Traceback (most recent call last):
[Sat Aug 29 19:39:43 2009] [error]   File "C:/WEB/wiki1/moin-1.8.2\\MoinMoin\\request\\request_wsgi.py", line 35, in __init__
[Sat Aug 29 19:39:43 2009] [error]     RequestBase.__init__(self, {})
[Sat Aug 29 19:39:43 2009] [error]   File "C:/WEB/wiki1/moin-1.8.2\\MoinMoin\\request\\__init__.py", line 212, in __init__
[Sat Aug 29 19:39:43 2009] [error]     user_obj = self.cfg.session_handler.start(self, self.cfg.session_id_handler)
[Sat Aug 29 19:39:43 2009] [error]   File "C:/WEB/wiki1/moin-1.8.2\\MoinMoin\\session.py", line 394, in start
[Sat Aug 29 19:39:43 2009] [error]     sessiondata = self.dataclass(request, session_name)
[Sat Aug 29 19:39:43 2009] [error]   File "C:/WEB/wiki1/moin-1.8.2\\MoinMoin\\session.py", line 108, in __init__
[Sat Aug 29 19:39:43 2009] [error]     self._data = self._ce.content()
[Sat Aug 29 19:39:43 2009] [error]   File "C:/WEB/wiki1/moin-1.8.2\\MoinMoin\\caching.py", line 259, in content
[Sat Aug 29 19:39:43 2009] [error]     self.close()
[Sat Aug 29 19:39:43 2009] [error]   File "C:/WEB/wiki1/moin-1.8.2\\MoinMoin\\caching.py", line 222, in close
[Sat Aug 29 19:39:43 2009] [error]     self._lock.release()
[Sat Aug 29 19:39:43 2009] [error]   File "C:/WEB/wiki1/moin-1.8.2\\MoinMoin\\util\\lock.py", line 349, in release
[Sat Aug 29 19:39:43 2009] [error]     return ReadLock.release(self)
[Sat Aug 29 19:39:43 2009] [error]   File "C:/WEB/wiki1/moin-1.8.2\\MoinMoin\\util\\lock.py", line 129, in release
[Sat Aug 29 19:39:43 2009] [error]     raise RuntimeError('lock already released: %s' % self.lockDir)
[Sat Aug 29 19:39:43 2009] [error] RuntimeError: lock already released: C:\\WEB\\wiki1\\wiki\\data\\cache\\__common__\\session\\__lock__\\read_lock_

/JanC

Plan

I did some testing on Windows 7RC and finally got rid of the tracebacks and lock failures by the patch below. But as this just increases timeouts and retries, there is some chance that with more attachments, slower machine, ... it maybe still could happen. The underlying reason that makes these ugly workarounds in filesys necessary so it works on win32 is still unknown.


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/CachingLockBroken (last edited 2009-09-10 11:14:18 by ThomasWaldmann)