Skip to content

Commit

Permalink
Merge pull request #8992 from ibzib/subprocess
Browse files Browse the repository at this point in the history
[BEAM-7670] portable py: prevent race opening worker subprocess
  • Loading branch information
ibzib committed Aug 19, 2019
2 parents eddaf92 + c7ace41 commit 7906149
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -496,7 +496,10 @@ def NotifyRunnerAvailable(self, start_worker_request, context):
self._worker_threads,
start_worker_request.worker_id)]
logging.warn("Starting worker with command %s" % (command))
worker_process = subprocess.Popen(command, stdout=subprocess.PIPE)
worker_process = subprocess.Popen(
command,
stdout=subprocess.PIPE,
close_fds=True)

# Register to kill the subprocess on exit.
atexit.register(worker_process.kill)
Expand Down

0 comments on commit 7906149

Please sign in to comment.