You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2013/06/07 22:49:50 UTC

svn commit: r1490816 - in /incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent: PuppetExecutor.py shell.py

Author: smohanty
Date: Fri Jun  7 20:49:50 2013
New Revision: 1490816

URL: http://svn.apache.org/r1490816
Log:
AMBARI-2325. Agent remains in Queued status and then times out. (smohanty)

Modified:
    incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py
    incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/shell.py

Modified: incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py?rev=1490816&r1=1490815&r2=1490816&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py Fri Jun  7 20:49:50 2013
@@ -170,7 +170,7 @@ class PuppetExecutor:
     puppetEnv = self.configureEnviron(puppetEnv)
     logger.debug("Setting RUBYLIB as: " + rubyLib)
     logger.info("Running command " + pprint.pformat(puppetcommand))
-    puppet = self.lauch_puppet_subprocess(puppetcommand,tmpout, tmperr, puppetEnv)
+    puppet = self.lauch_puppet_subprocess(puppetcommand, tmpout, tmperr, puppetEnv)
     logger.debug("Launching watchdog thread")
     self.event.clear()
     self.last_puppet_has_been_killed = False

Modified: incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/shell.py
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/shell.py?rev=1490816&r1=1490815&r2=1490816&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/shell.py (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/shell.py Fri Jun  7 20:49:50 2013
@@ -61,13 +61,17 @@ def killstaleprocesses():
 def killprocessgrp(pid):
   try:
     os.killpg(pid, signal.SIGTERM)
-    time.sleep(5)
-    try:
-      os.killpg(pid, signal.SIGKILL)
-    except:
-      logger.warn("Failed to send SIGKILL to PID %d. Process exited?" % (pid))
-  except:
-    logger.warn("Failed to kill PID %d" % (pid))      
+  except Exception, e:
+    logger.warn("Failed to kill PID %d" % (pid))
+    logger.warn("Reported error: " + repr(e))
+
+  time.sleep(5)
+
+  try:
+    os.killpg(pid, signal.SIGKILL)
+  except Exception, e:
+    logger.error("Failed to send SIGKILL to PID %d. Process exited?" % (pid))
+    logger.error("Reported error: " + repr(e))
 
 def changeUid():
   try: