From 34e6c0fb15a9954247b0b7d8170a62bd37e95df1 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 27 Jan 2016 12:53:11 +0000 Subject: [PATCH] fast exit dhcpbridge on 'old' When dnsmasq sends a lease change event ('old'), we do nothing. However we wait quite a long time before we do nothing, and have built up rpc connections to conductor by then. We should exit early in these cases instead to cause less backup getting dnsmasq lease events processed. Related-Bug: #1532809 Change-Id: I1539fb9eb8570a9efbaa95a1272ac9ac571c365a --- nova/cmd/dhcpbridge.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nova/cmd/dhcpbridge.py b/nova/cmd/dhcpbridge.py index e8098f456ab8..c6efa79f9fdc 100644 --- a/nova/cmd/dhcpbridge.py +++ b/nova/cmd/dhcpbridge.py @@ -120,6 +120,14 @@ def main(): logging.setup(CONF, "nova") global LOG LOG = logging.getLogger('nova.dhcpbridge') + + if CONF.action.name == 'old': + # NOTE(sdague): old is the most frequent message sent, and + # it's a noop. We should just exit immediately otherwise we + # can stack up a bunch of requests in dnsmasq. A SIGHUP seems + # to dump this list, so actions queued up get lost. + return + objects.register_all() if not CONF.conductor.use_local: @@ -130,7 +138,7 @@ def main(): LOG.warning(_LW('Conductor local mode is deprecated and will ' 'be removed in a subsequent release')) - if CONF.action.name in ['add', 'del', 'old']: + if CONF.action.name in ['add', 'del']: LOG.debug("Called '%(action)s' for mac '%(mac)s' with IP '%(ip)s'", {"action": CONF.action.name, "mac": CONF.action.mac,