You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2017/02/13 23:03:13 UTC

ambari git commit: AMBARI-19972. Stop All services call failed to stop flume agent.(vbrodetskyi)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 ff4c849ad -> b0af5f741


AMBARI-19972. Stop All services call failed to stop flume agent.(vbrodetskyi)


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

Branch: refs/heads/branch-2.5
Commit: b0af5f74181e9704eb9bf7fe8e897859885866ca
Parents: ff4c849
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Tue Feb 14 00:55:24 2017 +0200
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Tue Feb 14 00:55:24 2017 +0200

----------------------------------------------------------------------
 .../common-services/FLUME/1.4.0.2.0/package/scripts/flume.py     | 4 +++-
 ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py   | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b0af5f74/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume.py b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume.py
index 81b077f..7fff26e 100644
--- a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume.py
+++ b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume.py
@@ -220,8 +220,10 @@ def flume(action = None):
       if is_flume_process_live(pid_file):
         pid = shell.checked_call(("cat", pid_file), sudo=True)[1].strip()
         Execute(("kill", "-15", pid), sudo=True)    # kill command has to be a tuple
+        if not await_flume_process_termination(pid_file, try_count=30):
+          Execute(("kill", "-9", pid), sudo=True)
       
-      if not await_flume_process_termination(pid_file):
+      if not await_flume_process_termination(pid_file, try_count=10):
         show_logs(params.flume_log_dir, None)
         raise Fail("Can't stop flume agent: {0}".format(agent))
         

http://git-wip-us.apache.org/repos/asf/ambari/blob/b0af5f74/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py b/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py
index 4cf43c1..02810e2 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/FLUME/test_flume.py
@@ -122,7 +122,7 @@ class TestFlumeHandler(RMFTestCase):
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
 
     self.assertTrue(glob_mock.called)
-    await_flume_process_termination_mock.assert_called_with('/var/run/flume/a1.pid')
+    await_flume_process_termination_mock.assert_called_with('/var/run/flume/a1.pid', try_count=10)
 
     self.assertTrue(set_desired_mock.called)
     self.assertTrue(set_desired_mock.call_args[0][0] == 'INSTALLED')
@@ -421,7 +421,7 @@ class TestFlumeHandler(RMFTestCase):
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
 
     self.assertTrue(glob_mock.called)
-    await_flume_process_termination_mock.assert_called_with('/var/run/flume/b1.pid')
+    await_flume_process_termination_mock.assert_called_with('/var/run/flume/b1.pid', try_count=10)
 
     self.assertResourceCalled('File', '/var/run/flume/b1.pid', action = ['delete'])