AMBARI-2764. Improve logging when tasks fail due to timeouts. (smohanty)
Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/a3492ae0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/a3492ae0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/a3492ae0 Branch: refs/heads/trunk Commit: a3492ae027cc53a913bf0867b29a057ecac6bc3c Parents: 3c092f8 Author: Sumit Mohanty <[email protected]> Authored: Tue Jul 30 10:28:00 2013 -0700 Committer: Sumit Mohanty <[email protected]> Committed: Tue Jul 30 14:24:46 2013 -0700 ---------------------------------------------------------------------- ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py | 3 ++- ambari-server/conf/unix/log4j.properties | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/a3492ae0/ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py b/ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py index f42700d..ac26ec7 100644 --- a/ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py +++ b/ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py @@ -171,6 +171,7 @@ class PuppetExecutor: logger.debug("Setting RUBYLIB as: " + rubyLib) logger.info("Running command " + pprint.pformat(puppetcommand)) puppet = self.lauch_puppet_subprocess(puppetcommand, tmpout, tmperr, puppetEnv) + logger.info("Command started with PID: " + puppet.pid) logger.debug("Launching watchdog thread") self.event.clear() self.last_puppet_has_been_killed = False @@ -222,7 +223,7 @@ class PuppetExecutor: def puppet_watchdog_func(self, puppet): self.event.wait(self.PUPPET_TIMEOUT_SECONDS) if puppet.returncode is None: - logger.error("Task timed out and will be killed") + logger.error("Task timed out, killing process with PID: " + puppet.pid) shell.kill_process_with_children(puppet.pid) self.last_puppet_has_been_killed = True pass http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/a3492ae0/ambari-server/conf/unix/log4j.properties ---------------------------------------------------------------------- diff --git a/ambari-server/conf/unix/log4j.properties b/ambari-server/conf/unix/log4j.properties index d6a3935..e47ebdc 100644 --- a/ambari-server/conf/unix/log4j.properties +++ b/ambari-server/conf/unix/log4j.properties @@ -26,7 +26,7 @@ log4j.appender.file.File=/var/log/ambari-server/ambari-server.log log4j.appender.file.MaxFileSize=10MB log4j.appender.file.MaxBackupIndex=20 log4j.appender.file.layout=org.apache.log4j.PatternLayout -log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n +log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p [%t] %c{1}:%L - %m%n # Log config changes log4j.logger.configchange=INFO,configchange
