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 2018/07/19 13:28:25 UTC
[ambari] branch trunk updated: AMBARI-24309. Hadoop Metrics Sink
Precheck takes 5 minutes to complete - failing the prechecks API call due
to timeout. (aonishuk)
This is an automated email from the ASF dual-hosted git repository.
aonishuk pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push:
new b1763a3 AMBARI-24309. Hadoop Metrics Sink Precheck takes 5 minutes to complete - failing the prechecks API call due to timeout. (aonishuk)
b1763a3 is described below
commit b1763a3580e9d8421b4a11ae1691b5b6a7e9200b
Author: Andrew Onishuk <ao...@hortonworks.com>
AuthorDate: Thu Jul 19 15:05:17 2018 +0300
AMBARI-24309. Hadoop Metrics Sink Precheck takes 5 minutes to complete - failing the prechecks API call due to timeout. (aonishuk)
---
ambari-common/src/main/python/ambari_commons/shell.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ambari-common/src/main/python/ambari_commons/shell.py b/ambari-common/src/main/python/ambari_commons/shell.py
index c5cc247..c792c5e 100644
--- a/ambari-common/src/main/python/ambari_commons/shell.py
+++ b/ambari-common/src/main/python/ambari_commons/shell.py
@@ -494,6 +494,7 @@ def process_executor(command, timeout=__TIMEOUT_SECONDS, error_callback=None, st
yield []
return
kill_timer = threading.Timer(timeout, lambda: cmd.kill())
+ kill_timer.daemon = True
if timeout > -1:
kill_timer.start()
@@ -512,8 +513,6 @@ def process_executor(command, timeout=__TIMEOUT_SECONDS, error_callback=None, st
if error_callback and cmd.returncode and cmd.returncode > 0:
error_callback(command, cmd.stderr.readlines(), cmd.returncode)
except Exception as e:
- if kill_timer:
- kill_timer.cancel()
_logger.error("Exception during command '{0}' execution: {1}".format(command, str(e)))
if error_callback:
error_callback(command, [str(e)], -1)
@@ -522,6 +521,9 @@ def process_executor(command, timeout=__TIMEOUT_SECONDS, error_callback=None, st
finally:
if buff_queue:
buff_queue.notify_end()
+ if kill_timer:
+ kill_timer.cancel()
+ kill_timer.join()
def get_all_children(base_pid):