dont wait infinitely for the connection to zuul_console server

If security group or firewall on the target node silently drop
connection to zuul_console daemon - do not wait infinitely and instead
show a message.

After spending days figuring out the reason for zuul_console/stream not
working properly and figuring out that the default group of the node
does not allow 19885 connection from zuul-master (in default and zuul
security group) it became clear, that some extra information is required
back to user. I am open for making it timeout configurable, but 5 sec
should be enough initially.

Change-Id: I4e395b650e83a78d66aa362a420ef0d836c80d35
This commit is contained in:
Artem Goncharov 2018-05-11 15:42:08 +02:00
parent 1e3e5d33fb
commit 179a966655
1 changed files with 6 additions and 1 deletions

View File

@ -120,7 +120,12 @@ class CallbackModule(default.CallbackModule):
% (host, log_id, task_name), job=False, executor=True)
while True:
try:
s = socket.create_connection((ip, LOG_STREAM_PORT))
s = socket.create_connection((ip, LOG_STREAM_PORT), 5)
except socket.timeout:
self._log(
"Timeout exception waiting for the logger. "
"Please check connectivity to [%s:%s]"
% (ip, LOG_STREAM_PORT), executor=True)
except Exception:
self._log("[%s] Waiting on logger" % host,
executor=True, debug=True)