Add debug printouts for potential session reuse
We suspect session might be reused accross threads that leads to rare SSL errors. This extra printout can help debug the issue. Change-Id: I67e08ec48fb411d6d5a083fea6a6b68051f07617
This commit is contained in:
parent
60de62f64c
commit
afcefb8b44
|
@ -282,9 +282,9 @@ class RESTClient(object):
|
||||||
self._conn.set_silent(False)
|
self._conn.set_silent(False)
|
||||||
|
|
||||||
if not silent:
|
if not silent:
|
||||||
LOG.debug("REST call: %s %s. Headers: %s. Body: %s. Response: %s. "
|
LOG.debug("[%x] REST call: %s %s. Headers: %s. Body: %s. "
|
||||||
"Took %2.4f",
|
"Response: %s. Took %2.4f",
|
||||||
method, request_url,
|
id(self._conn), method, request_url,
|
||||||
utils.censor_headers(request_headers),
|
utils.censor_headers(request_headers),
|
||||||
self._mask_password(body),
|
self._mask_password(body),
|
||||||
result.json() if result.content else '',
|
result.json() if result.content else '',
|
||||||
|
|
|
@ -772,10 +772,11 @@ class ClusteredAPI(object):
|
||||||
kwargs_copy = copy.copy(kwargs)
|
kwargs_copy = copy.copy(kwargs)
|
||||||
kwargs_copy['headers'] = utils.censor_headers(
|
kwargs_copy['headers'] = utils.censor_headers(
|
||||||
kwargs_copy['headers'])
|
kwargs_copy['headers'])
|
||||||
LOG.debug("API cluster proxy %s %s to %s with %s. "
|
LOG.debug("[%x] API cluster proxy %s %s to %s "
|
||||||
"Waited conn: %2.4f, rate: %2.4f",
|
"with %s. Waited conn: %2.4f, rate: %2.4f",
|
||||||
proxy_for.upper(), uri, url, kwargs_copy,
|
id(conn), proxy_for.upper(), uri, url,
|
||||||
conn_data.conn_wait, conn_data.rate_wait)
|
kwargs_copy, conn_data.conn_wait,
|
||||||
|
conn_data.rate_wait)
|
||||||
|
|
||||||
# call the actual connection method to do the
|
# call the actual connection method to do the
|
||||||
# http request/response over the wire
|
# http request/response over the wire
|
||||||
|
@ -799,7 +800,7 @@ class ClusteredAPI(object):
|
||||||
|
|
||||||
return response
|
return response
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.warning("Request failed due to: %s", e)
|
LOG.warning("[%x] Request failed due to: %s", id(conn), e)
|
||||||
exc_config = self.nsxlib_config.exception_config
|
exc_config = self.nsxlib_config.exception_config
|
||||||
if exc_config.should_ground_endpoint(e):
|
if exc_config.should_ground_endpoint(e):
|
||||||
# consider endpoint inaccessible and move to next
|
# consider endpoint inaccessible and move to next
|
||||||
|
|
Loading…
Reference in New Issue