Commit 4e3a243b authored by Tres Seaver's avatar Tres Seaver

Merge from master.

parents 4895e57d b92d880c
*.pyc *.pyc
__pycache__ __pycache__
src/*.egg-info *.egg-info
benchmark/*.egg-info
.installed.cfg .installed.cfg
.tox .tox
bin bin
......
language: python
python:
- 2.6
- 2.7
install:
- python bootstrap.py
- bin/buildout
script:
- bin/test -v1
notifications:
email: false
...@@ -1024,7 +1024,8 @@ class ClientStorage(object): ...@@ -1024,7 +1024,8 @@ class ClientStorage(object):
else: else:
# We're using a server shared cache. If the file isn't # We're using a server shared cache. If the file isn't
# here, it's not anywhere. # here, it's not anywhere.
raise POSException.POSKeyError("No blob file", oid, serial) raise POSException.POSKeyError(
"No blob file at %s" % blob_filename, oid, serial)
if os.path.exists(blob_filename): if os.path.exists(blob_filename):
return _accessed(blob_filename) return _accessed(blob_filename)
...@@ -1112,18 +1113,19 @@ class ClientStorage(object): ...@@ -1112,18 +1113,19 @@ class ClientStorage(object):
if self._is_read_only: if self._is_read_only:
raise POSException.ReadOnlyError() raise POSException.ReadOnlyError()
self._tpc_cond.acquire() self._tpc_cond.acquire()
try:
self._midtxn_disconnect = 0 self._midtxn_disconnect = 0
while self._transaction is not None: while self._transaction is not None:
# It is allowable for a client to call two tpc_begins in a # It is allowable for a client to call two tpc_begins in a
# row with the same transaction, and the second of these # row with the same transaction, and the second of these
# must be ignored. # must be ignored.
if self._transaction == txn: if self._transaction == txn:
self._tpc_cond.release()
raise POSException.StorageTransactionError( raise POSException.StorageTransactionError(
"Duplicate tpc_begin calls for same transaction") "Duplicate tpc_begin calls for same transaction")
self._tpc_cond.wait(30) self._tpc_cond.wait(30)
self._transaction = txn self._transaction = txn
finally:
self._tpc_cond.release() self._tpc_cond.release()
try: try:
...@@ -1144,8 +1146,10 @@ class ClientStorage(object): ...@@ -1144,8 +1146,10 @@ class ClientStorage(object):
# the right way to set self._transaction to None # the right way to set self._transaction to None
# calls notify() on _tpc_cond in case there are waiting threads # calls notify() on _tpc_cond in case there are waiting threads
self._tpc_cond.acquire() self._tpc_cond.acquire()
try:
self._transaction = None self._transaction = None
self._tpc_cond.notify() self._tpc_cond.notify()
finally:
self._tpc_cond.release() self._tpc_cond.release()
def lastTransaction(self): def lastTransaction(self):
......
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