Unverified Commit 098d89af authored by J-shang's avatar J-shang Committed by GitHub
Browse files

fix process early exit and handle invalid in windows (#3258)

parent 7a1f09d9
......@@ -88,7 +88,13 @@ def _start_rest_server(config: ExperimentConfig, port: int, debug: bool, experim
for arg_key, arg_value in args.items():
cmd.append('--' + arg_key)
cmd.append(str(arg_value))
return int(time.time() * 1000), Popen(cmd, cwd=node_dir)
if sys.platform == 'win32':
from subprocess import CREATE_NEW_PROCESS_GROUP
proc = Popen(cmd, cwd=node_dir, creationflags=CREATE_NEW_PROCESS_GROUP)
else:
proc = Popen(cmd, cwd=node_dir)
return int(time.time() * 1000), proc
def _check_rest_server(port: int, retry: int = 3) -> None:
......
......@@ -31,7 +31,6 @@ if sys.platform == 'win32':
def close(self) -> None:
if self.file is not None:
self.file.close()
_winapi.CloseHandle(self._handle)
Pipe = WindowsPipe
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment