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:22 UTC

[ambari] branch branch-2.7 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 branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
     new 6bdbb00  AMBARI-24309. Hadoop Metrics Sink Precheck takes 5 minutes to complete - failing the prechecks API call due to timeout. (aonishuk)
6bdbb00 is described below

commit 6bdbb0000739294cd3f069e8be9f5992a7f325e4
Author: Andrew Onishuk <ao...@hortonworks.com>
AuthorDate: Thu Jul 19 15:18:24 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):