Repository: ambari Updated Branches: refs/heads/branch-2.5 2c16e73d8 -> ac0fb82c7 refs/heads/trunk 336e8e0a7 -> 9ef9bd501
AMBARI-20210. [BE] "refresh yarn queue" takes 20 minutes to fail, instead it should fail after a fixed numbers of the attempts within 2 minutes (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9ef9bd50 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9ef9bd50 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9ef9bd50 Branch: refs/heads/trunk Commit: 9ef9bd501a13d32b7033803ad3dca433e1fa98a0 Parents: 336e8e0 Author: Andrew Onishuk <[email protected]> Authored: Mon Feb 27 16:49:09 2017 +0200 Committer: Andrew Onishuk <[email protected]> Committed: Mon Feb 27 16:49:09 2017 +0200 ---------------------------------------------------------------------- .../main/python/resource_management/core/signal_utils.py | 1 + .../YARN/2.1.0.2.0/package/scripts/service.py | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/9ef9bd50/ambari-common/src/main/python/resource_management/core/signal_utils.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/core/signal_utils.py b/ambari-common/src/main/python/resource_management/core/signal_utils.py index 1f0dfe7..d166502 100644 --- a/ambari-common/src/main/python/resource_management/core/signal_utils.py +++ b/ambari-common/src/main/python/resource_management/core/signal_utils.py @@ -23,6 +23,7 @@ Ambari Agent __all__ = ["TerminateStrategy", "terminate_process"] import os +import time import signal from resource_management.core.base import Fail http://git-wip-us.apache.org/repos/asf/ambari/blob/9ef9bd50/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service.py index 78b2428..1c1b11b 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service.py @@ -25,6 +25,7 @@ from resource_management.core.shell import as_user, as_sudo from resource_management.libraries.functions.show_logs import show_logs from resource_management.libraries.functions.format import format from resource_management.core.resources.system import Execute, File +from resource_management.core.signal_utils import TerminateStrategy @OsFamilyFuncImpl(os_family=OSConst.WINSRV_FAMILY) def service(componentName, action='start', serviceName='yarn'): @@ -103,4 +104,11 @@ def service(componentName, action='start', serviceName='yarn'): elif action == 'refreshQueues': rm_kinit_cmd = params.rm_kinit_cmd refresh_cmd = format("{rm_kinit_cmd} export HADOOP_LIBEXEC_DIR={hadoop_libexec_dir} && {yarn_container_bin}/yarn rmadmin -refreshQueues") - Execute(refresh_cmd, user=usr) + + Execute(refresh_cmd, + user = usr, + timeout = 20, # when Yarn is not started command hangs forever and should be killed + tries = 5, + try_sleep = 5, + timeout_kill_strategy = TerminateStrategy.KILL_PROCESS_GROUP, # the process cannot be simply killed by 'kill -15', so kill pg group instread. + )
