Repository: ambari
Updated Branches:
  refs/heads/trunk 8d4af5707 -> 9f296a25c


AMBARI-9271. During enabling HA Hive Metastore Stop failed (aonishuk)


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

Branch: refs/heads/trunk
Commit: 9f296a25c67db4c21b059b102785cd93482b38e8
Parents: 8d4af57
Author: Andrew Onishuk <aonis...@hortonworks.com>
Authored: Thu Jan 22 19:09:13 2015 +0200
Committer: Andrew Onishuk <aonis...@hortonworks.com>
Committed: Thu Jan 22 19:09:13 2015 +0200

----------------------------------------------------------------------
 .../HIVE/0.12.0.2.0/package/scripts/hive_service.py       |  4 +++-
 .../test/python/stacks/2.0.6/HIVE/test_hive_metastore.py  | 10 ++++++++--
 .../src/test/python/stacks/2.0.6/HIVE/test_hive_server.py | 10 ++++++++--
 .../test/python/stacks/2.1/HIVE/test_hive_metastore.py    | 10 ++++++++--
 4 files changed, 27 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9f296a25/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
index a89d299..56e968a 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
@@ -111,7 +111,9 @@ def hive_service(name, action='start', 
rolling_restart=False):
     )
 
     # check if stopped the process, else fail the task
-    Execute(format("! ({process_id_exists_command})")
+    Execute(format("! ({process_id_exists_command})"),
+      tries=20,
+      try_sleep=3,
     )
 
     File(pid_file,

http://git-wip-us.apache.org/repos/asf/ambari/blob/9f296a25/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py 
b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
index 6eef93f..8140223 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
@@ -73,7 +73,10 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('Execute', 'sudo kill -9 `cat 
/var/run/hive/hive.pid`',
       not_if = '! (ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/hive/hive.pid` >/dev/null 2>&1) || ( sleep 5 && ! (ls 
/var/run/hive/hive.pid >/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` 
>/dev/null 2>&1) )',
     )
-    self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive.pid 
>/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1)',)
+    self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive.pid 
>/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1)',
+      tries = 20,
+      try_sleep = 3,
+    )
     self.assertResourceCalled('File', '/var/run/hive/hive.pid',
       action = ['delete'],
     )
@@ -127,7 +130,10 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('Execute', 'sudo kill -9 `cat 
/var/run/hive/hive.pid`',
       not_if = '! (ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/hive/hive.pid` >/dev/null 2>&1) || ( sleep 5 && ! (ls 
/var/run/hive/hive.pid >/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` 
>/dev/null 2>&1) )',
     )
-    self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive.pid 
>/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1)',)
+    self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive.pid 
>/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1)',
+      tries = 20,
+      try_sleep = 3,
+    )
     self.assertResourceCalled('File', '/var/run/hive/hive.pid',
      action = ['delete'],
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/9f296a25/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py 
b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
index 527c4c7..6d211ff 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
@@ -93,7 +93,10 @@ class TestHiveServer(RMFTestCase):
     self.assertResourceCalled('Execute', 'sudo kill -9 `cat 
/var/run/hive/hive-server.pid`',
       not_if = '! (ls /var/run/hive/hive-server.pid >/dev/null 2>&1 && ps -p 
`cat /var/run/hive/hive-server.pid` >/dev/null 2>&1) || ( sleep 5 && ! (ls 
/var/run/hive/hive-server.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/hive/hive-server.pid` >/dev/null 2>&1) )',
     )
-    self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive-server.pid 
>/dev/null 2>&1 && ps -p `cat /var/run/hive/hive-server.pid` >/dev/null 2>&1)',)
+    self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive-server.pid 
>/dev/null 2>&1 && ps -p `cat /var/run/hive/hive-server.pid` >/dev/null 2>&1)',
+      tries = 20,
+      try_sleep = 3,
+    )
     self.assertResourceCalled('File', '/var/run/hive/hive-server.pid',
       action = ['delete'],
     )
@@ -164,7 +167,10 @@ class TestHiveServer(RMFTestCase):
     self.assertResourceCalled('Execute', 'sudo kill -9 `cat 
/var/run/hive/hive-server.pid`',
       not_if = '! (ls /var/run/hive/hive-server.pid >/dev/null 2>&1 && ps -p 
`cat /var/run/hive/hive-server.pid` >/dev/null 2>&1) || ( sleep 5 && ! (ls 
/var/run/hive/hive-server.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/hive/hive-server.pid` >/dev/null 2>&1) )',
     )
-    self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive-server.pid 
>/dev/null 2>&1 && ps -p `cat /var/run/hive/hive-server.pid` >/dev/null 2>&1)',)
+    self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive-server.pid 
>/dev/null 2>&1 && ps -p `cat /var/run/hive/hive-server.pid` >/dev/null 2>&1)',
+      tries = 20,
+      try_sleep = 3,
+    )
     self.assertResourceCalled('File', '/var/run/hive/hive-server.pid',
       action = ['delete'],
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/9f296a25/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py 
b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
index 21aef34..19224c8 100644
--- a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
+++ b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
@@ -75,7 +75,10 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('Execute', 'sudo kill -9 `cat 
/var/run/hive/hive.pid`',
                               not_if = '! (ls /var/run/hive/hive.pid 
>/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1) || ( 
sleep 5 && ! (ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/hive/hive.pid` >/dev/null 2>&1) )',
                               )
-    self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive.pid 
>/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1)',)
+    self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive.pid 
>/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1)',
+      tries = 20,
+      try_sleep = 3,
+    )
     self.assertResourceCalled('File', '/var/run/hive/hive.pid',
                               action = ['delete'],
                               )
@@ -130,7 +133,10 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('Execute', 'sudo kill -9 `cat 
/var/run/hive/hive.pid`',
       not_if = '! (ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p `cat 
/var/run/hive/hive.pid` >/dev/null 2>&1) || ( sleep 5 && ! (ls 
/var/run/hive/hive.pid >/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` 
>/dev/null 2>&1) )',
     )
-    self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive.pid 
>/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1)',)
+    self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive.pid 
>/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1)',
+      tries = 20,
+      try_sleep = 3,
+    )
     self.assertResourceCalled('File', '/var/run/hive/hive.pid',
       action = ['delete'],
     )

Reply via email to