incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject svn commit: r1490816 - in /incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent: PuppetExecutor.py shell.py
Date Fri, 07 Jun 2013 20:49:50 GMT
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:



Mime
View raw message