Don't catch DBError in DHCP action handler

The DHCP port action handler has been catching DBErrors
since f1b9ac5a54, which is
well before we had the retry decorator to deal with these.
With the port action handler catching these, it means there
will not be retries on deadlocks or connection errors so
transient situations can result in a permanently broken
DHCP service for a network.

This removes the catch for DBError so the decorator can retry
the operation.

Closes-Bug: #1618216
Change-Id: I42031b481958bbfdb8f52902c294022717af7adf
This commit is contained in:
Kevin Benton 2016-08-27 05:03:54 -07:00
parent 79927038bc
commit 85ed7017ff
2 changed files with 1 additions and 8 deletions

View File

@ -20,7 +20,6 @@ import operator
from neutron_lib import constants
from neutron_lib import exceptions
from oslo_config import cfg
from oslo_db import exception as db_exc
from oslo_log import log as logging
import oslo_messaging
from oslo_utils import excutils
@ -101,8 +100,7 @@ class DhcpRpcCallback(object):
else:
msg = _('Unrecognized action')
raise exceptions.Invalid(message=msg)
except (db_exc.DBError,
exceptions.NetworkNotFound,
except (exceptions.NetworkNotFound,
exceptions.SubnetNotFound,
exceptions.IpAddressGenerationFailure) as e:
with excutils.save_and_reraise_exception(reraise=False) as ctxt:

View File

@ -16,7 +16,6 @@
import mock
from neutron_lib import constants
from neutron_lib import exceptions as n_exc
from oslo_db import exception as db_exc
from neutron.api.rpc.handlers import dhcp_rpc
from neutron.callbacks import resources
@ -140,10 +139,6 @@ class TestDhcpRpcCallback(base.BaseTestCase):
exc=n_exc.SubnetNotFound(subnet_id='foo_subnet_id'),
action='create_port')
def test_create_port_catch_db_error(self):
self._test__port_action_with_failures(exc=db_exc.DBError(),
action='create_port')
def test_create_port_catch_ip_generation_failure_reraise(self):
self.assertRaises(
n_exc.IpAddressGenerationFailure,