You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ma...@apache.org on 2016/12/16 20:42:59 UTC

ambari git commit: AMBARI-19201. Log size of status command queue size on Ambari agent (magyari_sandor)

Repository: ambari
Updated Branches:
  refs/heads/trunk 44e60728f -> fd1ff56af


AMBARI-19201. Log size of status command queue size on Ambari agent (magyari_sandor)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fd1ff56a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fd1ff56a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fd1ff56a

Branch: refs/heads/trunk
Commit: fd1ff56afba1cb84367947c7440371464ff594a5
Parents: 44e6072
Author: Sandor Magyari <sm...@hortonworks.com>
Authored: Thu Dec 15 14:25:29 2016 +0100
Committer: Sandor Magyari <sm...@hortonworks.com>
Committed: Fri Dec 16 21:42:35 2016 +0100

----------------------------------------------------------------------
 ambari-agent/src/main/python/ambari_agent/ActionQueue.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fd1ff56a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
index cb4fcb9..cc1a048 100644
--- a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
+++ b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
@@ -97,9 +97,13 @@ class ActionQueue(threading.Thread):
     return self._stop.isSet()
 
   def put_status(self, commands):
-    #Clear all status commands. Was supposed that we got all set of statuses, we don't need to keep old ones
-    while not self.statusCommandQueue.empty():
-      self.statusCommandQueue.get()
+    if not self.statusCommandQueue.empty():
+      #Clear all status commands. Was supposed that we got all set of statuses, we don't need to keep old ones
+      statusCommandQueueSize = 0
+      while not self.statusCommandQueue.empty():
+        self.statusCommandQueue.get()
+        statusCommandQueueSize = statusCommandQueueSize + 1
+      logger.info("Number of status commands removed from queue : " + str(statusCommandQueueSize))
 
     for command in commands:
       logger.info("Adding " + command['commandType'] + " for component " + \