Browse Source

Merge "[hca] Join threads before closing file descriptor"

changes/00/731000/10
Zuul 12 months ago
committed by Gerrit Code Review
parent
commit
05f7ceea17
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      dockerfiles/heat-container-agent/scripts/hooks/script

+ 7
- 2
dockerfiles/heat-container-agent/scripts/hooks/script View File

@ -87,9 +87,14 @@ def main(argv=sys.argv):
logger = dict(stdout=lambda line: log.info(line),
stderr=lambda line: log.debug(line))
with open(lp, 'w') as fd:
for label in ['stdout', 'stderr']:
threading.Thread(target=consumer, args=[label, fd]).start()
threads = []
for lb in ['stdout', 'stderr']:
t = threading.Thread(target=consumer, args=[lb, fd])
threads.append(t)
t.start()
deploy_status_code = subproc.wait()
for t in threads:
t.join()
if deploy_status_code:
log.error("Error running %s. [%s]\n" % (fn, deploy_status_code))


Loading…
Cancel
Save