incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r1183407 - in /incubator/ambari/trunk: CHANGES.txt agent/src/main/python/ambari_agent/ActionQueue.py agent/src/main/python/ambari_agent/Controller.py
Date Fri, 14 Oct 2011 16:17:49 GMT
Author: eyang
Date: Fri Oct 14 16:17:48 2011
New Revision: 1183407

URL: http://svn.apache.org/viewvc?rev=1183407&view=rev
Log:
AMBARI-71. Fix broken packaging and startup scripts. (Eric Yang)

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

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1183407&r1=1183406&r2=1183407&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Fri Oct 14 16:17:48 2011
@@ -2,6 +2,9 @@ Ambari Change log
 
 Release 0.1.0 - unreleased
 
+  AMBARI-74. Throttle the frequency of checking action queue to 5 seconds.
+  (Eric Yang)
+
   AMBARI-73. Implement cluster nodes CLI. (vgogate)
 
   AMBARI-72. Adding (dummy) blueprints before (dummy) cluster definitions and

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=1183407&r1=1183406&r2=1183407&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 Fri Oct 14 16:17:48
2011
@@ -26,6 +26,7 @@ from FileUtil import writeFile, createSt
 from shell import shellRunner
 import json
 import os
+import time
 
 logger = logging.getLogger()
 
@@ -62,6 +63,7 @@ class ActionQueue(threading.Thread):
         result = switches.get(action['kind'], self.unknownAction)(action)
         # Update the result
         r.put(result)
+      time.sleep(5)
 
   # Store action result to agent response queue
   def result(self):

Modified: incubator/ambari/trunk/agent/src/main/python/ambari_agent/Controller.py
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/agent/src/main/python/ambari_agent/Controller.py?rev=1183407&r1=1183406&r2=1183407&view=diff
==============================================================================
--- incubator/ambari/trunk/agent/src/main/python/ambari_agent/Controller.py (original)
+++ incubator/ambari/trunk/agent/src/main/python/ambari_agent/Controller.py Fri Oct 14 16:17:48
2011
@@ -67,7 +67,6 @@ class Controller(threading.Thread):
     while True:
       try:
         data = json.dumps(self.heartbeat.build(id))
-        logger.info(data)
         req = urllib2.Request(self.url, data, {'Content-Type': 'application/json'})
         f = urllib2.urlopen(req)
         response = f.read()
@@ -76,7 +75,10 @@ class Controller(threading.Thread):
         id=data['responseId']
         self.actionQueue.put(data)
       except URLError, err:
-        logger.error(err.code)
+        if "code" in err:
+          logger.error(err.code)
+        else:
+          logger.error("Unable to connect to: "+self.url)
       if self.actionQueue.isIdle():
         time.sleep(30)
       else:
@@ -116,6 +118,5 @@ def main(argv=None):
   controller.start()
   controller.run()
 
-
 if __name__ == '__main__':
   main()



Mime
View raw message