def retry_db_errors(f):
 @_tag_retriables_as_unretriable
 @_retry_db_errors
 @six.wraps(f)
 def wrapped(*args, **kwargs):
  try:
   dup_args = [_copy_if_lds(a) for a in args]
   dup_kwargs = {k: _copy_if_lds(v) for (k, v) in kwargs.items()}
   return f(*dup_args, **dup_kwargs)
  except Exception as e:
   with excutils.save_and_reraise_exception():
    if is_retriable(e):
     LOG.debug('Retry wrapper got retriable exception: %s', traceback.format_exc())
 return wrapped

def retry_db_errors ( f ) : @ _tag_retriables_as_unretriable @ _retry_db_errors @ six . wraps ( f ) def wrapped ( * args , ** kwargs ) : try : dup_args = [ _copy_if_lds ( a ) for a in args ] dup_kwargs = { k : _copy_if_lds ( v ) for ( k , v ) in kwargs . items ( ) } return f ( * dup_args , ** dup_kwargs ) except Exception as e : with excutils . save_and_reraise_exception ( ) : if is_retriable ( e ) : LOG . debug ( 'Retry wrapper got retriable exception: %s' , traceback . format_exc ( ) ) return wrapped
nesting-safe retry decorator with auto-arg-copy and logging .