Description

Runtime error "Lock already released"

/!\ Duplicate of MoinMoinBugs/RandomlyFailToDisplayAttachedImages.

Steps to reproduce

  1. I have installed moinmoin 1.7.1 using Activepython.
  2. Post installation, things went fine.
  3. However almost always after sometime OR if I come back the next day and fetch the page I would be hit upon with below error.
  4. The problem is I can't reproduce it consistently. The only thing that I am doing is: fetch the page and nothing else.

Example

Traceback (most recent call last):
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\request\__init__.py", line 1307, in run
    handler(self.page.page_name, self)
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\action\__init__.py", line 243, in do_show
    if not request.user.may.read(pagename):
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\security\__init__.py", line 146, in <lambda>
    return lambda pagename: _check(self.request, pagename, self.name, attr)
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\security\__init__.py", line 54, in _check
    allowed = cache.acl_rights_before.may(request, username, right)
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\security\__init__.py", line 310, in may
    is_group_member = request.dicts.has_member
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\request\__init__.py", line 346, in getDicts
    dicts.load_dicts()
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\wikidicts.py", line 309, in load_dicts
    self.scan_dicts()
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\wikidicts.py", line 358, in scan_dicts
    cache.update(data)
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\caching.py", line 246, in update
    self.close()
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\caching.py", line 220, in close
    self._lock.release()
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\util\lock.py", line 375, in release
    return WriteLock.release(self)
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\util\lock.py", line 123, in release
    raise RuntimeError("lock already released")
RuntimeError: lock already released

Additionally cgitb raised this exception:
Traceback (most recent call last):
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\failure.py", line 171, in handle
    handler.handle()
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\support\cgitb.py", line 576, in handle
    doc = view.format(formatter, self.context)
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\support\cgitb.py", line 354, in format
    return formatter.section(self.formatContent(), {'class': 'cgitb'})
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\failure.py", line 44, in formatContent
    self.formatDebugInfo(),
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\failure.py", line 100, in formatDebugInfo
    self.formatTraceback(),
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\failure.py", line 113, in formatTraceback
    return self.formatAllTracebacks(self.formatOneTraceback)
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\failure.py", line 125, in formatAllTracebacks
    tracebacks.append(formatFuction((ttype, tvalue, tb)))
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\support\cgitb.py", line 434, in formatOneTraceback
    self.formatter.orderedList(self.tracebackFrames(info),
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\support\cgitb.py", line 445, in tracebackFrames
    frames.append(frame.format(self.formatter))
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\support\cgitb.py", line 201, in format
    vars, highlight = self.scan()
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\support\cgitb.py", line 290, in scan
    vars = self.scanVariables(reader)
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\support\cgitb.py", line 305, in scanVariables
    value = getattr(parent, token, __UNDEF__)
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\request\__init__.py", line 346, in getDicts
    dicts.load_dicts()
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\wikidicts.py", line 309, in load_dicts
    self.scan_dicts()
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\wikidicts.py", line 358, in scan_dicts
    cache.update(data)
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\caching.py", line 246, in update
    self.close()
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\caching.py", line 220, in close
    self._lock.release()
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\util\lock.py", line 375, in release
    return WriteLock.release(self)
  File "D:\pythonwiki\moin_1_7_1\MoinMoin\util\lock.py", line 123, in release
    raise RuntimeError("lock already released")
RuntimeError: lock already released

Component selection

Details

MoinMoin Version

1.7.1

OS and Version

WinXP SP3 Pro

Python Version

2.5.2.2

Server Setup

None, using python itself

Server Details

NTFS file system

Language you are using the wiki in (set in the browser/UserPreferences)

US-ENG

Workaround

Discussion

IIRC, there is a related bug already reported in another bug. Maybe try to merge bugs and information contained.

Also, it would be nice to know more about your system level software that might interfere with moin on the filesystem level, e.g. virus scanners.

This seems to be a browser issue: could only reproduce this bug with IE7, not with Firefox, Opera. Can someone confirm this? I guess Python's / Moin's built-in web server seems to have problems with IE. Sometimes I also get errors like "Remote Closed Connection".

This happens with all browsers. It seems to be related to cache or lock functions and does only appear on XP/NTFS. I regret moving from Moin 1.5 to 1.8. It is not related to any virus scanner and it doesn't matter if your running Moin as CGI, WSGI or FCGI. This bug is definitly driving me to pmwiki. / Jan C

Can you explain how you trigger that problem with 1.8.x? -- ReimarBauer 2009-05-05 11:01:23

I just request a page which consists of many pages à la

<<Include(^bblog/2009-.*,,sort=descending, items=500, editlink)>> 

Most of the pages includes attached jpg files. / Jan C

I would like also to reproduce this error. this is my example / testcase:

I never get the error when Moin is running locally. It only appears when the browser is running on a client and moin on the server. In my case the server is a dual-core machine. I get the error every time on then Include i.e. compound page.

Anything I can do clarify?

/ Jan C

some more questions:

surge_action_limits = None # disable surge protection Surgeprotection is disabled. Moin runs on XP SP3, Python 2.4, Apache 2.x with mod_wsgi. It makes no difference if Moin run with CGI, fcgi or wsgi. No virus software, nothing but a postgres db that does other things now and then. I use client side SSL. The problem seems to have something to do with timing and the frequence of access. (I'm a bit suspicius of the locking or/and cache code in Moin. Why bother with lock for read access?) / Jan C

The problem has something to do with session caching. When I'm logged in, moin often fails to return some images. When I'm not logged in, the problem never occurs.

/ Jan C

OK! I finally found a patch for 1.6 at MoinMoinBugs/CachingLockFail by OlegKobchenko. Applying parts of it to 1.8 actually makes the bug disappear. Changing the lock timeout from 1.0 ?? to 10.0 makes a real difference. I really suprises me that patch Oleg supplied in march 2008 is not included in later versions of Moin. Obviously new features are more important than stability on supported plattforms. Of course, it could be that win32 is not supported by moin any longer, though.

/ Jan C

No! We just want to have an example to reproduce such problems. But that seems somehow difficult to understand. And why didn't one of you comment on the patchset given on that page? ReimarBauer/Photo/img.png -- ReimarBauer 2009-05-10 21:13:53

It's to much work. You already stated that you don't have the time to set up a complex configuration...... The bug does not appear in standalone moin. It does not appear on linux. I get it with XP SP3, NTFS, WSGI/CGI/FCGI and Apache 2.0.x, SSL. That is what is needed. What infuence the client-side SSL have, I'm not really sure of but I beleive none. Without the patch moin fails to serve all images on a page, when there are more than 5-6 of them, every time. This is because of the exceptions. The faster server and the faster client the worse it gets. That is consistent with timing and thread problems. This is really all the help I can give you without attaching my whole server.

/ Jan C

Forcing a stepping of 10s can't be a good solution. We were asking for a data_dir zip file which can be used to reliably reproduces the problem. That sounds not like much work to me.

Yes, 10s for some simple file ops sound insane. There is something severely going wrong on windows and we should try to find out what. Could be done if someone provides VNC or RDP access to a server where this happens, so a developer could debug this "live" on that machine without having to waste many hours for trying to duplicate the windows setup. If someone is interested, contact me by email, please, see my wiki homepage. -- ThomasWaldmann 2009-05-11 11:17:01

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/RandomLockAlreadyReleased (last edited 2010-03-03 10:19:11 by ThomasWaldmann)