You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ey...@apache.org on 2011/10/31 19:50:36 UTC

svn commit: r1195610 - in /incubator/ambari/trunk: CHANGES.txt agent/src/main/python/ambari_agent/ActionQueue.py

Author: eyang
Date: Mon Oct 31 18:50:35 2011
New Revision: 1195610

URL: http://svn.apache.org/viewvc?rev=1195610&view=rev
Log:
AMBARI-118. Added safe guard mechanism to prevent agent crash on 
faulty action. (Eric Yang)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/agent/src/main/python/ambari_agent/ActionQueue.py

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1195610&r1=1195609&r2=1195610&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Mon Oct 31 18:50:35 2011
@@ -2,6 +2,9 @@ Ambari Change log
 
 Release 0.1.0 - unreleased
 
+  AMBARI-118. Added safe guard mechanism to prevent agent crash on 
+  faulty action. (Eric Yang)
+
   AMBARI-117. If some install action is sent in a heartbeat response, the
   latter should also include the dependent components' installs. (ddas)
 

Modified: incubator/ambari/trunk/agent/src/main/python/ambari_agent/ActionQueue.py
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/agent/src/main/python/ambari_agent/ActionQueue.py?rev=1195610&r1=1195609&r2=1195610&view=diff
==============================================================================
--- incubator/ambari/trunk/agent/src/main/python/ambari_agent/ActionQueue.py (original)
+++ incubator/ambari/trunk/agent/src/main/python/ambari_agent/ActionQueue.py Mon Oct 31 18:50:35 2011
@@ -70,7 +70,11 @@ class ActionQueue(threading.Thread):
                      'DELETE_STRUCTURE_ACTION' : self.deleteStructureAction,
                      'WRITE_FILE_ACTION'       : self.writeFileAction
                    }
-        result = switches.get(action['kind'], self.unknownAction)(action)
+        try:
+          result = switches.get(action['kind'], self.unknownAction)(action)
+        except Exception, err:
+          result = self.genResult(action)
+          result['exitCode']=1
         # Update the result
         r.put(result)
       if not self.stopped():