Return-Path: X-Original-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3981F10648 for ; Fri, 7 Jun 2013 20:50:11 +0000 (UTC) Received: (qmail 22920 invoked by uid 500); 7 Jun 2013 20:50:11 -0000 Delivered-To: apmail-incubator-ambari-commits-archive@incubator.apache.org Received: (qmail 22899 invoked by uid 500); 7 Jun 2013 20:50:11 -0000 Mailing-List: contact ambari-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-commits@incubator.apache.org Received: (qmail 22892 invoked by uid 99); 7 Jun 2013 20:50:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jun 2013 20:50:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jun 2013 20:50:09 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 85D6A23888D2; Fri, 7 Jun 2013 20:49:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1490816 - in /incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent: PuppetExecutor.py shell.py Date: Fri, 07 Jun 2013 20:49:50 -0000 To: ambari-commits@incubator.apache.org From: smohanty@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130607204950.85D6A23888D2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: smohanty Date: Fri Jun 7 20:49:50 2013 New Revision: 1490816 URL: http://svn.apache.org/r1490816 Log: AMBARI-2325. Agent remains in Queued status and then times out. (smohanty) Modified: incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/shell.py Modified: incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py?rev=1490816&r1=1490815&r2=1490816&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py (original) +++ incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/PuppetExecutor.py Fri Jun 7 20:49:50 2013 @@ -170,7 +170,7 @@ class PuppetExecutor: puppetEnv = self.configureEnviron(puppetEnv) logger.debug("Setting RUBYLIB as: " + rubyLib) logger.info("Running command " + pprint.pformat(puppetcommand)) - puppet = self.lauch_puppet_subprocess(puppetcommand,tmpout, tmperr, puppetEnv) + puppet = self.lauch_puppet_subprocess(puppetcommand, tmpout, tmperr, puppetEnv) logger.debug("Launching watchdog thread") self.event.clear() self.last_puppet_has_been_killed = False Modified: incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/shell.py URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/shell.py?rev=1490816&r1=1490815&r2=1490816&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/shell.py (original) +++ incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/shell.py Fri Jun 7 20:49:50 2013 @@ -61,13 +61,17 @@ def killstaleprocesses(): def killprocessgrp(pid): try: os.killpg(pid, signal.SIGTERM) - time.sleep(5) - try: - os.killpg(pid, signal.SIGKILL) - except: - logger.warn("Failed to send SIGKILL to PID %d. Process exited?" % (pid)) - except: - logger.warn("Failed to kill PID %d" % (pid)) + except Exception, e: + logger.warn("Failed to kill PID %d" % (pid)) + logger.warn("Reported error: " + repr(e)) + + time.sleep(5) + + try: + os.killpg(pid, signal.SIGKILL) + except Exception, e: + logger.error("Failed to send SIGKILL to PID %d. Process exited?" % (pid)) + logger.error("Reported error: " + repr(e)) def changeUid(): try: