[API] Remove deadlock detection code

It triggered for things that were not deadlocks causing more harm than good.
Also the newer algorithms in 4.x onwards should not require it.

Change-Id: I476a17ea5da5b760ab6c681a64af34b70e97c0f9
This commit is contained in:
Andrew Hutchings
2013-11-21 13:55:21 +00:00
committed by David Shrewsbury
parent 7c6254ac54
commit 80ed39a74b

View File

@@ -29,7 +29,6 @@ from libra.api.library.exp import ImmutableEntity
from libra.openstack.common import log
from libra.common.exc import DetailError
from wsme.rest.json import tojson
from sqlalchemy.exc import OperationalError, ResourceClosedError
LOG = log.getLogger(__name__)
@@ -94,9 +93,6 @@ def wsexpose(*args, **kwargs):
@functools.wraps(f)
def callfunction(self, *args, **kwargs):
for x in xrange(5):
old_args = args
old_kwargs = kwargs
try:
args, kwargs = wsme.rest.args.get_args(
funcdef, args, kwargs, pecan.request.params, None,
@@ -112,14 +108,6 @@ def wsexpose(*args, **kwargs):
pecan.response.status = result.status_code
result = result.obj
# ResourceClosedError happens on for_update deadlock
except (OperationalError, ResourceClosedError):
LOG.warning(
"Galera deadlock, retry {0}".format(x + 1)
)
args = old_args
kwargs = old_kwargs
continue
except:
data = wsme.api.format_exception(
sys.exc_info(),
@@ -144,13 +132,6 @@ def wsexpose(*args, **kwargs):
datatype=funcdef.return_type,
result=result
)
# After 5 retries of transaction, give up!
data = wsme.api.format_exception(
sys.exc_info(),
pecan.conf.get('wsme', {}).get('debug', False)
)
pecan.response.status = 500
return data
pecan_xml_decorate(callfunction)
pecan_json_decorate(callfunction)