Commit cf7c12a9 authored by Julien Muchembled's avatar Julien Muchembled

Sync ZODB patch with NEO

Commit 2f881b06 was a wrong fix because RLock
does not raise 'thread.error' like Lock (when releasing an unacquired lock).

(cf commit b709cc899fa17ed14569a96395ad2def3a545db4 of NEO project)
parent 3ccbd091
......@@ -44,10 +44,10 @@ if 1: # keep indentation. Also good for quick disabling.
if FORCE_STORAGE_SYNC_ON_CONNECTION_OPENING:
try:
if Connection._nexedi_fix != 4:
if Connection._nexedi_fix != 5:
raise Exception("A different ZODB fix is already applied")
except AttributeError:
Connection._nexedi_fix = 4
Connection._nexedi_fix = 5
# Whenever an connection is opened (and there's usually an existing one
# in DB pool that can be reused) whereas the transaction is already
......@@ -56,14 +56,12 @@ if 1: # keep indentation. Also good for quick disabling.
# For example, there's no open transaction when a ZPublisher/Publish
# transaction begins.
import thread
def open(self, *args, **kw):
def _flush_invalidations():
acquire = self._db._a
try:
self._db._r()
except thread.error:
self._db._r() # this is a RLock
except RuntimeError:
acquire = lambda: None
try:
del self._flush_invalidations
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment