You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Jonathan Matthew (JIRA)" <ji...@apache.org> on 2017/11/19 00:32:00 UTC

[jira] [Updated] (AMBARI-22473) shell.process_executor races process exit

     [ https://issues.apache.org/jira/browse/AMBARI-22473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Matthew updated AMBARI-22473:
--------------------------------------
    Status: Patch Available  (was: Open)

From a6cd34a32fb4c2708a52ddd30b6b8c1d8115e732 Mon Sep 17 00:00:00 2001
From: Jonathan Matthew <jo...@uq.edu.au>
Date: Sun, 19 Nov 2017 10:26:39 +1000
Subject: [PATCH] AMBARI-22473 - shell.process_executor races process exit

---
 ambari-common/src/main/python/ambari_commons/shell.py | 2 +-
 1 file changed, 1 insertion(+), 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 021e495f27..22ee979564 100644
--- a/ambari-common/src/main/python/ambari_commons/shell.py
+++ b/ambari-common/src/main/python/ambari_commons/shell.py
@@ -187,7 +187,7 @@ def process_executor(command, timeout=None, error_callback=None):
 
   yield cmd.stdout
 
-  exit_code = cmd.poll()
+  exit_code = cmd.wait()
   event.set()
   thread.join()
 
-- 
2.13.6


> shell.process_executor races process exit
> -----------------------------------------
>
>                 Key: AMBARI-22473
>                 URL: https://issues.apache.org/jira/browse/AMBARI-22473
>             Project: Ambari
>          Issue Type: Bug
>    Affects Versions: 2.6.0
>            Reporter: Jonathan Matthew
>
> By calling cmd.poll(), shell.process_executor assumes that the subcommand will have exited once it has finished reading from its stdout pipe. This isn't necessarily the case, so it should call cmd.wait() instead.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)