Do not print router resize messages when not resizing

I noticed in the functional logs that the l3-agent is constantly
logging this message, even when just adding or removing a single
router:

  Resizing router processing queue green pool size to: 8

It's misleading as the pool is not being resized, it's still 8,
so let's only log when we're actually changing the pool size.

Change-Id: I5dc42fa4b4c1964b7d027681b61550cd82e83234
This commit is contained in:
Brian Haley 2019-02-28 11:52:53 -05:00
parent 376fa8aef4
commit 22369ba7fe
1 changed files with 10 additions and 6 deletions

View File

@ -268,7 +268,8 @@ class L3NATAgent(ha.AgentMixin,
self.metadata_driver)
# L3 agent router processing green pool
self._pool = eventlet.GreenPool(size=ROUTER_PROCESS_GREENLET_MIN)
self._pool_size = ROUTER_PROCESS_GREENLET_MIN
self._pool = eventlet.GreenPool(size=self._pool_size)
self._queue = queue.ResourceProcessingQueue()
super(L3NATAgent, self).__init__(host=self.conf.host)
@ -420,12 +421,15 @@ class L3NATAgent(ha.AgentMixin,
@lockutils.synchronized('resize_greenpool')
def _resize_process_pool(self):
self._pool_size = max([ROUTER_PROCESS_GREENLET_MIN,
min([ROUTER_PROCESS_GREENLET_MAX,
len(self.router_info)])])
pool_size = max([ROUTER_PROCESS_GREENLET_MIN,
min([ROUTER_PROCESS_GREENLET_MAX,
len(self.router_info)])])
if pool_size == self._pool_size:
return
LOG.info("Resizing router processing queue green pool size to: %d",
self._pool_size)
self._pool.resize(self._pool_size)
pool_size)
self._pool.resize(pool_size)
self._pool_size = pool_size
def _router_added(self, router_id, router):
ri = self._create_router(router_id, router)