If deadlock exception is raised during allocation of multiple ips,
this exception gets rewritten by rollback mechnism. Rollback tries
to deallocate already allocated ips, but can't do it because database
is not operatable unless entire transaction is restarted. So another
exception is generated and it prevents retry wrappers from restarting
transaction correctly.
To fix this behavior rollback actions are covered with try-except block.
This way any exception during rollback operations do not replace
original exception.
Reviewed: https:/ /review. openstack. org/306519 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=1f5008564de 03bcd5d03743bdb ce004bb27aaad1
Committed: https:/
Submitter: Jenkins
Branch: master
commit 1f5008564de03bc d5d03743bdbce00 4bb27aaad1
Author: Pavel Bondar <email address hidden>
Date: Fri Apr 15 18:29:19 2016 +0300
Do not rewrite original exception for IPAM
If deadlock exception is raised during allocation of multiple ips,
this exception gets rewritten by rollback mechnism. Rollback tries
to deallocate already allocated ips, but can't do it because database
is not operatable unless entire transaction is restarted. So another
exception is generated and it prevents retry wrappers from restarting
transaction correctly.
To fix this behavior rollback actions are covered with try-except block.
This way any exception during rollback operations do not replace
original exception.
Partial-Bug: #1571666 4be5221338b003d 371750374d0
Change-Id: Ifdba7c49dc4a77