ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject ambari git commit: AMBARI-15786. Add some logs to help co-related task ids from server and agent (smohanty)
Date Mon, 11 Apr 2016 14:43:28 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk c6fa8c26f -> dcca89db5


AMBARI-15786. Add some logs to help co-related task ids from server and agent (smohanty)


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

Branch: refs/heads/trunk
Commit: dcca89db5ef39b514c1d7b92cc585f46b55ef908
Parents: c6fa8c2
Author: Sumit Mohanty <smohanty@hortonworks.com>
Authored: Mon Apr 11 07:22:04 2016 -0700
Committer: Sumit Mohanty <smohanty@hortonworks.com>
Committed: Mon Apr 11 07:42:55 2016 -0700

----------------------------------------------------------------------
 .../src/main/python/ambari_agent/ActionQueue.py         | 12 +++++++-----
 .../apache/ambari/server/agent/HeartBeatHandler.java    |  2 ++
 .../apache/ambari/server/agent/HeartbeatProcessor.java  |  2 +-
 3 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/dcca89db/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
index 6f98661..d603566 100644
--- a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
+++ b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
@@ -227,10 +227,10 @@ class ActionQueue(threading.Thread):
     commandId = command['commandId']
     isCommandBackground = command['commandType'] == self.BACKGROUND_EXECUTION_COMMAND
     isAutoExecuteCommand = command['commandType'] == self.AUTO_EXECUTION_COMMAND
-    message = "Executing command with id = {commandId} for role = {role} of " \
+    message = "Executing command with id = {commandId}, taskId = {taskId} for role = {role}
of " \
               "cluster {cluster}.".format(
-              commandId = str(commandId), role=command['role'],
-              cluster=clusterName)
+              commandId = str(commandId), taskId = str(command['taskId']),
+              role=command['role'], cluster=clusterName)
     logger.info(message)
 
     taskId = command['taskId']
@@ -350,11 +350,13 @@ class ActionQueue(threading.Thread):
         if command['roleCommand'] == self.ROLE_COMMAND_START:
           self.controller.recovery_manager.update_current_status(command['role'], LiveStatus.LIVE_STATUS)
           self.controller.recovery_manager.update_config_staleness(command['role'], False)
-          logger.info("After EXECUTION_COMMAND (START), current state of " + command['role']
+ " to " +
+          logger.info("After EXECUTION_COMMAND (START), with taskId=" + str(command['taskId'])
+
+                      ", current state of " + command['role'] + " to " +
                        self.controller.recovery_manager.get_current_status(command['role'])
)
         elif command['roleCommand'] == self.ROLE_COMMAND_STOP or command['roleCommand'] ==
self.ROLE_COMMAND_INSTALL:
           self.controller.recovery_manager.update_current_status(command['role'], LiveStatus.DEAD_STATUS)
-          logger.info("After EXECUTION_COMMAND (STOP/INSTALL), current state of " + command['role']
+ " to " +
+          logger.info("After EXECUTION_COMMAND (STOP/INSTALL), with taskId=" + str(command['taskId'])
+
+                      ", current state of " + command['role'] + " to " +
                        self.controller.recovery_manager.get_current_status(command['role'])
)
         elif command['roleCommand'] == self.ROLE_COMMAND_CUSTOM_COMMAND:
           if command['hostLevelParams'].has_key('custom_command') and \

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcca89db/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
index aebaf22..35a37e3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
@@ -329,6 +329,8 @@ public class HeartBeatHandler {
           case BACKGROUND_EXECUTION_COMMAND:
           case EXECUTION_COMMAND: {
             ExecutionCommand ec = (ExecutionCommand)ac;
+            LOG.info("HeartBeatHandler.sendCommands: sending ExecutionCommand for host {},
role {}, roleCommand {}, and command ID {}, task ID {}",
+                     ec.getHostname(), ec.getRole(), ec.getRoleCommand(), ec.getCommandId(),
ec.getTaskId());
             Map<String, String> hlp = ec.getHostLevelParams();
             if (hlp != null) {
               String customCommand = hlp.get("custom_command");

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcca89db/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java
b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java
index 955daac..37a8395 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java
@@ -548,7 +548,7 @@ public class HeartbeatProcessor extends AbstractService{
             }
 
             LOG.error("Operation failed - may be retried. Service component host: "
-                + schName + ", host: " + hostname + " Action id" + report.getActionId());
+                + schName + ", host: " + hostname + " Action id " + report.getActionId()
+ " and Task id " + report.getTaskId());
             if (actionManager.isInProgressCommand(report)) {
               scHost.handleEvent(new ServiceComponentHostOpFailedEvent
                   (schName, hostname, now));


Mime
View raw message