]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove duplicated debug logging around locking
authorRawlin Peters <rawlin.peters@hp.com>
Mon, 15 Jun 2015 16:57:02 +0000 (10:57 -0600)
committerRawlin Peters <rawlin.peters@hp.com>
Tue, 16 Jun 2015 18:35:20 +0000 (12:35 -0600)
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

index 20d38a3f12b9646f675eb6d1d661f747c40f0e65..a65e769c0b6c4dafd69e3c65432cf3a64277dc28 100644 (file)
@@ -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.