Skip to content

Commit

Permalink
forkserver: wait for child process in main thread
Browse files Browse the repository at this point in the history
This ensures the pid remains valid, so that the calls to killpg_safe in
ForkServer.close work.
  • Loading branch information
pv committed Sep 19, 2018
1 parent ca63acc commit 7645516
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion asv/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ def __init__(self, env, root):

def _stdout_reader(self):
try:
out, _ = self.server_proc.communicate()
out = self.server_proc.stdout.read()
out = out.decode('utf-8', 'replace')
except Exception as exc:
import traceback
Expand Down Expand Up @@ -815,6 +815,7 @@ def close(self):
# Kill process group
util._killpg_safe(self.server_proc.pid, signal.SIGKILL)

self.server_proc.wait()
self.stdout_reader_thread.join()

if self._server_output and not self.interrupted:
Expand Down

0 comments on commit 7645516

Please sign in to comment.