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/20 13:38:22 UTC

[ambari] branch trunk updated: AMBARI-24324. install tasks sometimes fail (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 8102517  AMBARI-24324. install tasks sometimes fail (aonishuk)
8102517 is described below

commit 8102517131cf019e8111f3332a209468a88a0a3a
Author: Andrew Onishuk <ao...@hortonworks.com>
AuthorDate: Fri Jul 20 15:02:20 2018 +0300

    AMBARI-24324. install tasks sometimes fail (aonishuk)
---
 ambari-common/src/main/python/ambari_commons/shell.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ambari-common/src/main/python/ambari_commons/shell.py b/ambari-common/src/main/python/ambari_commons/shell.py
index c792c5e..9f3d463 100644
--- a/ambari-common/src/main/python/ambari_commons/shell.py
+++ b/ambari-common/src/main/python/ambari_commons/shell.py
@@ -487,6 +487,7 @@ def process_executor(command, timeout=__TIMEOUT_SECONDS, error_callback=None, st
 
   buff_queue = None
   kill_timer = None
+  kill_timer_started = False
 
   try:
     cmd = launch_subprocess(command, env=env)
@@ -497,6 +498,7 @@ def process_executor(command, timeout=__TIMEOUT_SECONDS, error_callback=None, st
     kill_timer.daemon = True
     if timeout > -1:
       kill_timer.start()
+      kill_timer_started = True
 
     if strategy == ReaderStrategy.BufferedQueue:
       buff_queue = BufferedQueue()
@@ -521,7 +523,7 @@ def process_executor(command, timeout=__TIMEOUT_SECONDS, error_callback=None, st
   finally:
     if buff_queue:
       buff_queue.notify_end()
-    if kill_timer:
+    if kill_timer and kill_timer_started:
       kill_timer.cancel()
       kill_timer.join()