ambari-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Matthew (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Deleted] (AMBARI-22473) shell.process_executor races process exit
Date Sun, 19 Nov 2017 00:32:00 GMT

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

Jonathan Matthew updated AMBARI-22473:
--------------------------------------
    Comment: was deleted

(was: From a6cd34a32fb4c2708a52ddd30b6b8c1d8115e732 Mon Sep 17 00:00:00 2001
From: Jonathan Matthew <jonathan@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)

Mime
View raw message