Merge "Make OVO exception NeutronDbObjectDuplicateEntry retriable"

This commit is contained in:
Jenkins 2016-11-11 17:04:41 +00:00 committed by Gerrit Code Review
commit 0e6aea1553
1 changed files with 3 additions and 1 deletions

View File

@ -31,6 +31,7 @@ from sqlalchemy.orm import exc
import traceback
from neutron._i18n import _LE
from neutron.objects import exceptions as obj_exc
def set_hook(engine):
@ -53,7 +54,8 @@ def is_retriable(e):
return False
if _is_nested_instance(e, (db_exc.DBDeadlock, exc.StaleDataError,
db_exc.DBConnectionError,
db_exc.DBDuplicateEntry, db_exc.RetryRequest)):
db_exc.DBDuplicateEntry, db_exc.RetryRequest,
obj_exc.NeutronDbObjectDuplicateEntry)):
return True
# looking savepoints mangled by deadlocks. see bug/1590298 for details.
return _is_nested_instance(e, db_exc.DBError) and '1305' in str(e)