Skip to content

Commit

Permalink
fixes subprocess.wait() hanging
Browse files Browse the repository at this point in the history
  • Loading branch information
zrq495 committed Jan 28, 2019
1 parent 9535dd4 commit 8612bf9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions localstack/services/awslambda/lambda_executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ def run_lambda_executor(self, cmd, env_vars={}, asynchronous=False):
result = '{"asynchronous": "%s"}' % asynchronous
log_output = 'Lambda executed asynchronously'
else:
return_code = process.wait()
result = to_str(process.stdout.read())
log_output = to_str(process.stderr.read())
result, log_output = process.communicate()
result = to_str(result)
log_output = to_str(log_output)
return_code = process.returncode

if return_code != 0:
raise Exception('Lambda process returned error status code: %s. Output:\n%s' %
Expand Down

0 comments on commit 8612bf9

Please sign in to comment.