mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-29 05:03:34 +08:00
ctlmgr,worker: set PYTHONUNBUFFERED for subprocesses
This commit is contained in:
parent
ca3cced0b4
commit
155c2ec2ef
@ -81,9 +81,12 @@ class Controller:
|
||||
logger.info("Starting controller %s with command: %s",
|
||||
self.name, self.command)
|
||||
try:
|
||||
env = os.environ.copy()
|
||||
env["PYTHONUNBUFFERED"] = "1"
|
||||
self.process = await asyncio.create_subprocess_exec(
|
||||
*shlex.split(self.command),
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
env=env)
|
||||
asyncio.ensure_future(
|
||||
LogParser(self._get_log_source).stream_task(
|
||||
self.process.stdout))
|
||||
|
@ -81,10 +81,13 @@ class Worker:
|
||||
if self.closed.is_set():
|
||||
raise WorkerError("Attempting to create process after close")
|
||||
self.ipc = pipe_ipc.AsyncioParentComm()
|
||||
env = os.environ.copy()
|
||||
env["PYTHONUNBUFFERED"] = "1"
|
||||
await self.ipc.create_subprocess(
|
||||
sys.executable, "-m", "artiq.master.worker_impl",
|
||||
self.ipc.get_address(), str(log_level),
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
env=env)
|
||||
asyncio.ensure_future(
|
||||
LogParser(self._get_log_source).stream_task(
|
||||
self.ipc.process.stdout))
|
||||
|
Loading…
Reference in New Issue
Block a user