Repository: ambari
Updated Branches:
  refs/heads/branch-dev-patch-upgrade 79e678653 -> c8edd3c8a


AMBARI-18417. Improve agent logging to add more relevant message (aonishuk)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0c6c141993740065892a608fc0a7cd5c197d3d85
Parents: d1ac8bd
Author: Andrew Onishuk <aonis...@hortonworks.com>
Authored: Mon Sep 19 18:59:54 2016 +0300
Committer: Andrew Onishuk <aonis...@hortonworks.com>
Committed: Mon Sep 19 18:59:54 2016 +0300

----------------------------------------------------------------------
 ambari-agent/src/main/python/ambari_agent/Controller.py | 4 +++-
 ambari-agent/src/main/python/ambari_agent/Hardware.py   | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0c6c1419/ambari-agent/src/main/python/ambari_agent/Controller.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/Controller.py 
b/ambari-agent/src/main/python/ambari_agent/Controller.py
index 7100656..2a4d384 100644
--- a/ambari-agent/src/main/python/ambari_agent/Controller.py
+++ b/ambari-agent/src/main/python/ambari_agent/Controller.py
@@ -232,12 +232,14 @@ class Controller(threading.Thread):
       logger.debug("No commands received from %s", self.serverHostname)
     else:
       """Only add to the queue if not empty list """
+      logger.info("Adding %s commands. Heartbeat id = %s", len(commands), 
self.responseId)
       self.actionQueue.put(commands)
 
   def addToStatusQueue(self, commands):
     if not commands:
       logger.debug("No status commands received from %s", self.serverHostname)
     else:
+      logger.info("Adding %s status commands. Heartbeat id = %s", 
len(commands), self.responseId)
       if not LiveStatus.SERVICES:
         self.updateComponents(commands[0]['clusterName'])
       self.recovery_manager.process_status_commands(commands)
@@ -278,7 +280,7 @@ class Controller(threading.Thread):
       try:
         crt_time = time.time()
         if crt_time - heartbeat_running_msg_timestamp > int(state_interval):
-          logger.info("Heartbeat with server is running...")
+          logger.info("Heartbeat (response id = %s) with server is 
running...", self.responseId)
           heartbeat_running_msg_timestamp = crt_time
 
         send_state = False

http://git-wip-us.apache.org/repos/asf/ambari/blob/0c6c1419/ambari-agent/src/main/python/ambari_agent/Hardware.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/Hardware.py 
b/ambari-agent/src/main/python/ambari_agent/Hardware.py
index 17acdf2..3ab7700 100644
--- a/ambari-agent/src/main/python/ambari_agent/Hardware.py
+++ b/ambari-agent/src/main/python/ambari_agent/Hardware.py
@@ -102,7 +102,7 @@ class Hardware:
   @staticmethod
   def _chk_mount(mountpoint):
     try:
-      return call(['test', '-w', mountpoint], sudo=True, 
timeout=int(Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_DEFAULT)/2)[0] == 0
+      return call(['test', '-w', mountpoint], sudo=True, 
timeout=int(Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_DEFAULT)/2, quiet=(not 
logger.isEnabledFor(logging.DEBUG)))[0] == 0
     except ExecuteTimeoutException:
       logger.exception("Exception happened while checking mount 
{0}".format(mountpoint))
       return False

Reply via email to