ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From echekans...@apache.org
Subject ambari git commit: AMBARI-20582 Single process executor possibly can cause deadlock.
Date Mon, 27 Mar 2017 15:25:26 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d69b58234 -> db9e72912


AMBARI-20582 Single process executor possibly can cause deadlock.


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

Branch: refs/heads/trunk
Commit: db9e72912e6948352bc15f3e146f96631e1157c8
Parents: d69b582
Author: Eugene Chekanskiy <echekanskiy@hortonworks.com>
Authored: Mon Mar 27 18:24:44 2017 +0300
Committer: Eugene Chekanskiy <echekanskiy@hortonworks.com>
Committed: Mon Mar 27 18:24:44 2017 +0300

----------------------------------------------------------------------
 .../src/main/python/ambari_agent/StatusCommandsExecutor.py    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/db9e7291/ambari-agent/src/main/python/ambari_agent/StatusCommandsExecutor.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/StatusCommandsExecutor.py b/ambari-agent/src/main/python/ambari_agent/StatusCommandsExecutor.py
index eaa24c2..04a3e85 100644
--- a/ambari-agent/src/main/python/ambari_agent/StatusCommandsExecutor.py
+++ b/ambari-agent/src/main/python/ambari_agent/StatusCommandsExecutor.py
@@ -52,8 +52,11 @@ class SingleProcessStatusCommandsExecutor(StatusCommandsExecutor):
     self.need_relaunch = False
 
   def put_commands(self, commands):
-    while not self.statusCommandQueue.empty():
-      self.statusCommandQueue.get()
+    with self.statusCommandQueue.mutex:
+      qlen = len(self.statusCommandQueue.queue)
+      if qlen:
+        logger.info("Removing %s stale status commands from queue", qlen)
+      self.statusCommandQueue.queue.clear()
 
     for command in commands:
       logger.info("Adding " + command['commandType'] + " for component " + \


Mime
View raw message