AMBARI-21239. Ambari leaves a lot of processes from Hive alert on the machine (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/31ac3c21 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/31ac3c21 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/31ac3c21 Branch: refs/heads/branch-feature-AMBARI-20859 Commit: 31ac3c21b71868df4f4e2ac82e72defa79767bd6 Parents: f80c6ee Author: Andrew Onishuk <aonis...@hortonworks.com> Authored: Tue Jun 13 17:01:06 2017 +0300 Committer: Andrew Onishuk <aonis...@hortonworks.com> Committed: Tue Jun 13 17:01:06 2017 +0300 ---------------------------------------------------------------------- .../libraries/functions/hive_check.py | 5 ++++- .../stacks/2.0.6/HIVE/test_hive_service_check.py | 14 +++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/31ac3c21/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py b/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py index 92d16a2..d8f6696 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py @@ -21,6 +21,7 @@ limitations under the License. from resource_management.core import global_lock from resource_management.core.resources import Execute from resource_management.libraries.functions import format +from resource_management.core.signal_utils import TerminateStrategy def check_thrift_port_sasl(address, port, hive_auth="NOSASL", key=None, kinitcmd=None, smokeuser='ambari-qa', @@ -76,4 +77,6 @@ def check_thrift_port_sasl(address, port, hive_auth="NOSASL", key=None, kinitcmd Execute(cmd, user=smokeuser, path=["/bin/", "/usr/bin/", "/usr/lib/hive/bin/", "/usr/sbin/"], - timeout=check_command_timeout) + timeout=check_command_timeout, + timeout_kill_strategy=TerminateStrategy.KILL_PROCESS_TREE, + ) http://git-wip-us.apache.org/repos/asf/ambari/blob/31ac3c21/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py index 0e5dac7..0d87315 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py @@ -46,6 +46,7 @@ class TestServiceCheck(RMFTestCase): path = ['/bin/', '/usr/bin/', '/usr/lib/hive/bin/', '/usr/sbin/'], user = 'ambari-qa', timeout = 30, + timeout_kill_strategy = 2, ) self.assertResourceCalled('File', '/tmp/hcatSmoke.sh', content = StaticFile('hcatSmoke.sh'), @@ -160,6 +161,7 @@ class TestServiceCheck(RMFTestCase): path = ['/bin/', '/usr/bin/', '/usr/lib/hive/bin/', '/usr/sbin/'], user = 'ambari-qa', timeout = 30, + timeout_kill_strategy = 2, ) self.assertResourceCalled('File', '/tmp/hcatSmoke.sh', content = StaticFile('hcatSmoke.sh'), @@ -276,7 +278,9 @@ class TestServiceCheck(RMFTestCase): self.assertResourceCalled('Execute', "! beeline -u 'jdbc:hive2://c6402.ambari.apache.org:10010/;transportMode=binary' -e '' 2>&1| awk '{print}'|grep -i -e 'Connection refused' -e 'Invalid URL'", path = ['/bin/', '/usr/bin/', '/usr/lib/hive/bin/', '/usr/sbin/'], timeout = 30, - user = 'ambari-qa') + user = 'ambari-qa', + timeout_kill_strategy = 2, + ) self.assertResourceCalled('File', '/tmp/hcatSmoke.sh', content = StaticFile('hcatSmoke.sh'), @@ -313,13 +317,17 @@ class TestServiceCheck(RMFTestCase): "! beeline -u 'jdbc:hive2://c6402.ambari.apache.org:10010/;transportMode=binary' -e '' 2>&1| awk '{print}'|grep -i -e 'Connection refused' -e 'Invalid URL'", path = ['/bin/', '/usr/bin/', '/usr/lib/hive/bin/', '/usr/sbin/'], timeout = 30, - user = 'ambari-qa') + user = 'ambari-qa', + timeout_kill_strategy = 2, + ) self.assertResourceCalled('Execute', "! beeline -u 'jdbc:hive2://c6402.ambari.apache.org:10500/;transportMode=binary' -e '' 2>&1| awk '{print}'|grep -i -e 'Connection refused' -e 'Invalid URL'", path = ['/bin/', '/usr/bin/', '/usr/lib/hive/bin/', '/usr/sbin/'], timeout = 30, - user = 'ambari-qa') + user = 'ambari-qa', + timeout_kill_strategy = 2, + ) # LLAP call self.assertResourceCalled('Execute',