nwangtw commented on a change in pull request #3201: Enable gperftool HEAPCHECK
in integration test
URL: https://github.com/apache/incubator-heron/pull/3201#discussion_r264348955
##########
File path: heron/executor/src/python/heron_executor.py
##########
@@ -881,10 +898,17 @@ def _run_process(self, name, cmd, env_to_exec=None):
try:
# stderr is redirected to stdout so that it can more easily be logged.
stderr has a max buffer
# size and can cause the child process to deadlock if it fills up
- process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
- env=env_to_exec, bufsize=1)
-
- proc.async_stream_process_stdout(process, stdout_log_fn(name))
+ if isinstance(cmd, dict) and cmd.has_key('env'):
+ Log.info("command %s env %s" % (' '.join(cmd['cmd']), '
'.join(cmd['env'])))
+ if env_to_exec is not None:
+ cmd['env'].update(env_to_exec)
+ process = subprocess.Popen(cmd['cmd'], stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
+ env=cmd['env'], bufsize=1)
+ proc.async_stream_process_stdout(process, stdout_log_fn(name))
+ else:
+ process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
Review comment:
so when cmd is a dict and it doesn't have 'env', this branch is called?
Maybe it might be cleaner to construct a normalized_cmd object that contains
'cmd' and 'env' and then call popen to execute it?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services