Bug 1532236 Improve logging and timeouts in partials generation r=mtabara

Differential Revision: https://phabricator.services.mozilla.com/D21909

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Simon Fraser 2019-03-04 11:56:47 +00:00
Родитель 06f53c0bdb
Коммит da5338fa4b
2 изменённых файлов: 19 добавлений и 17 удалений

Просмотреть файл

@ -156,26 +156,28 @@ async def run_command(cmd, cwd='/', env=None, label=None, silent=False):
env = dict()
process = await asyncio.create_subprocess_shell(cmd,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.STDOUT,
stderr=asyncio.subprocess.PIPE,
cwd=cwd, env=env)
stdout, stderr = await process.communicate()
if label:
label = "{}: ".format(label)
else:
label = ""
await process.wait()
async def read_output(stream, label, printcmd):
while True:
line = await stream.readline()
if line == b'':
break
printcmd("%s%s", label, line.decode('utf-8'))
if silent:
return
if not stderr:
stderr = ""
if not stdout:
stdout = ""
label = "{}: ".format(label)
for line in stdout.splitlines():
log.debug("%s%s", label, line.decode('utf-8'))
for line in stderr.splitlines():
log.warn("%s%s", label, line.decode('utf-8'))
await process.wait()
else:
await asyncio.gather(
read_output(process.stdout, label, log.info),
read_output(process.stderr, label, log.warn)
)
await process.wait()
async def unpack(work_env, mar, dest_dir):

Просмотреть файл

@ -122,7 +122,7 @@ def make_task_description(config, jobs):
'implementation': 'docker-worker',
'docker-image': {'in-tree': 'funsize-update-generator'},
'os': 'linux',
'max-run-time': 3600,
'max-run-time': 600,
'chain-of-trust': True,
'taskcluster-proxy': True,
'env': {