Comment 6 for bug 1294855

Revision history for this message
SamP (sampath-priyankara) wrote :

This is not reproducible in stable juno.
cinder db access mechanism has changed since then.
Didnt have time to look how we got there, sorry

In openstack cinder 2013.2.1, we only had this.
@require_context
def quota_reserve(context, resources, quotas, deltas, expire,
                  until_refresh, max_age, project_id=None):

In cinder stable/juno there is a retry mechanism
@require_context
@_retry_on_deadlock
def quota_reserve(context, resources, quotas, deltas, expire,
                  until_refresh, max_age, project_id=None):
   .
   .
   .
def _retry_on_deadlock(f):
    """Decorator to retry a DB API call if Deadlock was received."""
    @functools.wraps(f)
    def wrapped(*args, **kwargs):
        while True:
            try:
                return f(*args, **kwargs)
            except db_exc.DBDeadlock:
                LOG.warn(_("Deadlock detected when running "
                           "'%(func_name)s': Retrying..."),
                         dict(func_name=f.__name__))
                # Retry!
                time.sleep(0.5)
                continue
    functools.update_wrapper(wrapped, f)
    return wrapped

I did a simple test as it in reproduce script in top of the report.
create 200 NFS spared volumes without problem.
cinder logs are also attached.