From fc0c3a83659a86453acd5745a5632729b99cb3de Mon Sep 17 00:00:00 2001 From: Rawlin Peters Date: Mon, 15 Jun 2015 10:57:02 -0600 Subject: [PATCH] Remove duplicated debug logging around locking Currently, iptables_manager.py does extra unnecessary logging about lock acquisition and release. It uses lockutils.lock() which passes do_log=True by default, which causes lockutils.lock() to do debug logging about lock acquisition/release. IptablesManager itself also writes debug log info about lock acquisition and release. This change will eliminate unnecessary duplicate logging in order to reduce log noise about locking. This change is also related to https://github.com/harlowja/fasteners/commit/f88f2fea7fe250b7d26cdcbc84633ccbbc68eeee which reduces the logging level in the underlying lock implementation used by oslo.concurrency. That change along with this one will remove the duplicate debug logging about locking in iptables_manager.py and also in ipset_manager.py. Change-Id: If6f4a7101f3783ad83645e28bbb5c577dd403d3b Closes-Bug: 1464727 --- neutron/agent/linux/iptables_manager.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/neutron/agent/linux/iptables_manager.py b/neutron/agent/linux/iptables_manager.py index 20d38a3f1..a65e769c0 100644 --- a/neutron/agent/linux/iptables_manager.py +++ b/neutron/agent/linux/iptables_manager.py @@ -423,12 +423,8 @@ class IptablesManager(object): if self.namespace: lock_name += '-' + self.namespace - try: - with lockutils.lock(lock_name, utils.SYNCHRONIZED_PREFIX, True): - LOG.debug('Got semaphore / lock "%s"', lock_name) - return self._apply_synchronized() - finally: - LOG.debug('Semaphore / lock released "%s"', lock_name) + with lockutils.lock(lock_name, utils.SYNCHRONIZED_PREFIX, True): + return self._apply_synchronized() def _apply_synchronized(self): """Apply the current in-memory set of iptables rules. -- 2.45.2