AMBARI-18147. On envs with slow sudo status commands make the agent laggy 
(aonishuk)


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

Branch: refs/heads/branch-dev-logsearch
Commit: 8ebdd91ba5c864eaa8d8aa7b2f0aaadab8d41818
Parents: e3f9dbd
Author: Andrew Onishuk <aonis...@hortonworks.com>
Authored: Mon Aug 15 14:14:11 2016 +0300
Committer: Andrew Onishuk <aonis...@hortonworks.com>
Committed: Mon Aug 15 14:14:11 2016 +0300

----------------------------------------------------------------------
 ambari-server/src/main/package/rpm/preinstall.sh     |  2 +-
 .../package/scripts/application_timeline_server.py   |  2 --
 .../python/stacks/2.1/YARN/test_apptimelineserver.py | 15 ---------------
 3 files changed, 1 insertion(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8ebdd91b/ambari-server/src/main/package/rpm/preinstall.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/package/rpm/preinstall.sh 
b/ambari-server/src/main/package/rpm/preinstall.sh
index 6291c9e..c5b2641 100644
--- a/ambari-server/src/main/package/rpm/preinstall.sh
+++ b/ambari-server/src/main/package/rpm/preinstall.sh
@@ -49,7 +49,7 @@ then
     mkdir "$AMBARI_VIEWS_BACKUP_FOLDER"
 fi
 
-ls $AMBARI_VIEWS_FOLDER/*.jar 2>&1 > /dev/null
+ls $AMBARI_VIEWS_FOLDER/*.jar > /dev/null 2>&1
 JARS_EXIST="$?"
 if [ -d "$AMBARI_VIEWS_FOLDER" ] && [ -d "$AMBARI_VIEWS_BACKUP_FOLDER" ] && [ 
"$JARS_EXIST" -eq 0 ]
 then

http://git-wip-us.apache.org/repos/asf/ambari/blob/8ebdd91b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py
index 81fc94f..14a6cc3 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py
@@ -81,8 +81,6 @@ class 
ApplicationTimelineServerDefault(ApplicationTimelineServer):
   def status(self, env):
     import status_params
     env.set_params(status_params)
-    Execute(format("mv {yarn_historyserver_pid_file_old} 
{yarn_historyserver_pid_file}"),
-            only_if = format("test -e {yarn_historyserver_pid_file_old}", 
user=status_params.yarn_user))
     check_process_status(status_params.yarn_historyserver_pid_file)
 
   def security_status(self, env):

http://git-wip-us.apache.org/repos/asf/ambari/blob/8ebdd91b/ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py 
b/ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py
index 1a0c788..f56907c 100644
--- a/ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py
+++ b/ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py
@@ -269,21 +269,6 @@ class TestAppTimelineServer(RMFTestCase):
                               )
 
 
-  def test_status(self):
-    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/application_timeline_server.py",
-                       classname="ApplicationTimelineServer",
-                       command="status",
-                       config_file="default.json",
-                       stack_version = self.STACK_VERSION,
-                       target = RMFTestCase.TARGET_COMMON_SERVICES
-    )
-
-    self.assertResourceCalled('Execute', 'mv 
/var/run/hadoop-yarn/yarn/yarn-yarn-historyserver.pid 
/var/run/hadoop-yarn/yarn/yarn-yarn-timelineserver.pid',
-        only_if = 'test -e 
/var/run/hadoop-yarn/yarn/yarn-yarn-historyserver.pid',
-    )
-    self.assertNoMoreResources()
-
-
   
@patch("resource_management.libraries.functions.security_commons.build_expectations")
   
@patch("resource_management.libraries.functions.security_commons.get_params_from_filesystem")
   
@patch("resource_management.libraries.functions.security_commons.validate_security_config_properties")

Reply via email to