Commit b0b43f3a authored by Edward Lemur's avatar Edward Lemur Committed by Commit Bot

git-cl: Log response IP and host for Gerrit RPC failures.

Bug: 881860
Change-Id: I32a8c27ba912bf76feda86940c7f30a5462f527f
Reviewed-on: https://chromium-review.googlesource.com/c/1279128Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent 1e488131
......@@ -78,6 +78,7 @@ testing_support/google_appengine
# Ignore emacs / vim backup files.
*~
*.swp
# Ignore the monitoring config. It is unique for each user.
/metrics.cfg
......@@ -466,7 +466,14 @@ def ReadHttpResponse(conn, accept_statuses=frozenset([200])):
for header, value in response.iteritems()
if header.lower() in INTERESTING_HEADERS
)
GERRIT_ERR_LOGGER.info('Gerrit RPC failures:\n%s\n', rpc_headers)
GERRIT_ERR_LOGGER.info(
'Gerrit RPC failure headers:\n'
' Host: %s\n'
' Ip: %s\n'
'%s\n',
conn.connections.values()[0].host,
conn.connections.values()[0].sock.getpeername(),
rpc_headers)
else:
# A status >=500 is assumed to be a possible transient error; retry.
http_version = 'HTTP/%s' % ('1.1' if response.version == 11 else '1.0')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment