You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2014/12/29 15:35:44 UTC
ambari git commit: AMBARI-8939. Hbase Regionserver sometimes hangs on
stop during HA enabled (aonishuk)
Repository: ambari
Updated Branches:
refs/heads/trunk 1652163e8 -> a0ea540ce
AMBARI-8939. Hbase Regionserver sometimes hangs on stop during HA enabled (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a0ea540c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a0ea540c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a0ea540c
Branch: refs/heads/trunk
Commit: a0ea540ceb628bd7f73c86faa8797e61b8f9f834
Parents: 1652163
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Dec 29 16:35:39 2014 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Mon Dec 29 16:35:39 2014 +0200
----------------------------------------------------------------------
.../src/main/python/resource_management/core/shell.py | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/a0ea540c/ambari-common/src/main/python/resource_management/core/shell.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/shell.py b/ambari-common/src/main/python/resource_management/core/shell.py
index 89060bd..3301481 100644
--- a/ambari-common/src/main/python/resource_management/core/shell.py
+++ b/ambari-common/src/main/python/resource_management/core/shell.py
@@ -30,7 +30,6 @@ import inspect
import subprocess
import threading
import traceback
-from multiprocessing import Queue
from exceptions import Fail
from exceptions import ExecuteTimeoutException
from resource_management.core.logger import Logger
@@ -142,8 +141,8 @@ def _call(command, logoutput=None, throw_on_failure=True,
preexec_fn=preexec_fn)
if timeout:
- q = Queue()
- t = threading.Timer( timeout, _on_timeout, [proc, q] )
+ timeout_event = threading.Event()
+ t = threading.Timer( timeout, _on_timeout, [proc, timeout_event] )
t.start()
if not wait_for_finish:
@@ -172,8 +171,8 @@ def _call(command, logoutput=None, throw_on_failure=True,
proc.wait()
out = out.strip('\n')
- if timeout:
- if q.empty():
+ if timeout:
+ if not timeout_event.is_set():
t.cancel()
# timeout occurred
else:
@@ -242,8 +241,8 @@ def _get_environment_str(env):
def string_cmd_from_args_list(command):
return ' '.join(quote_bash_args(x) for x in command)
-def _on_timeout(proc, q):
- q.put(True)
+def _on_timeout(proc, timeout_event):
+ timeout_event.set()
if proc.poll() == None:
try:
proc.terminate()