From 669e2d66fa720416e07c135cb3d1aebe1952332c Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Mon, 21 Jan 2019 12:39:53 -0500 Subject: [PATCH] Improve exception handling of fingerclient This is to improve the following traceback, today we don't display what server / port is. Traceback (most recent call last): File "/opt/venv/zuul-3.4.0/lib/python3.6/site-packages/zuul/lib/fingergw.py", line 80, in handle build_uuid, File "/opt/venv/zuul-3.4.0/lib/python3.6/site-packages/zuul/lib/fingergw.py", line 51, in _fingerClient with socket.create_connection((server, port), timeout=10) as s: File "/usr/lib/python3.6/socket.py", line 704, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Temporary failure in name resolution Change-Id: I2adb79b8fc3e12cb971b59e3d89c3dfc24a10a67 Signed-off-by: Paul Belanger --- zuul/lib/fingergw.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zuul/lib/fingergw.py b/zuul/lib/fingergw.py index 4f603f3242..38cc5ec64b 100644 --- a/zuul/lib/fingergw.py +++ b/zuul/lib/fingergw.py @@ -81,7 +81,9 @@ class RequestHandler(streamer_utils.BaseFingerRequestHandler): except BrokenPipeError: # Client disconnect return except Exception: - self.log.exception('Finger request handling exception:') + self.log.exception( + 'Finger request handling exception (%s:%s):', + port_location['server'], port_location['port']) msg = 'Internal streaming error' self.request.sendall(msg.encode('utf-8')) return