Try to early terminate streaming on ansible errors

Currently when ansible has an error when trying to run a command or
shell task the command module has no chance to send any console
log. Thus zuul_stream doesn't terminate by itself and gets killed
after a timeout of 30s. As a try to fix this zuul_console sends
periodically a notice about the not found logfile. When requesting the
streamer to exit it can check then if there is still no console file
and exit by itself without needing to timeout.

Change-Id: I42bc05b0d2c530fbfc00c6295da24d18a6ec6435
This commit is contained in:
Tobias Henkel
2017-08-04 21:07:24 +02:00
parent f5cdd49fc3
commit 09fabaf722
2 changed files with 9 additions and 0 deletions

View File

@@ -185,6 +185,7 @@ class Server(object):
console = self.chunkConsole(conn, log_uuid)
if console:
break
conn.send('[Zuul] Log not found\n')
time.sleep(0.5)
while True:
if self.followConsole(console, conn):