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

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

commit f5647be02ddbf2166410edce38d5e1554c14a618
Author: Andrew Onishuk <ao...@hortonworks.com>
AuthorDate: Fri Jul 20 15:02:28 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()