Browse Source

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
changes/04/772604/3
Anna Khmelnitsky 1 year ago
parent
commit
afcefb8b44
  1. 6
      vmware_nsxlib/v3/client.py
  2. 11
      vmware_nsxlib/v3/cluster.py

6
vmware_nsxlib/v3/client.py

@ -282,9 +282,9 @@ class RESTClient(object):
self._conn.set_silent(False)
if not silent:
LOG.debug("REST call: %s %s. Headers: %s. Body: %s. Response: %s. "
"Took %2.4f",
method, request_url,
LOG.debug("[%x] REST call: %s %s. Headers: %s. Body: %s. "
"Response: %s. Took %2.4f",
id(self._conn), method, request_url,
utils.censor_headers(request_headers),
self._mask_password(body),
result.json() if result.content else '',

11
vmware_nsxlib/v3/cluster.py

@ -772,10 +772,11 @@ class ClusteredAPI(object):
kwargs_copy = copy.copy(kwargs)
kwargs_copy['headers'] = utils.censor_headers(
kwargs_copy['headers'])
LOG.debug("API cluster proxy %s %s to %s with %s. "
"Waited conn: %2.4f, rate: %2.4f",
proxy_for.upper(), uri, url, kwargs_copy,
conn_data.conn_wait, conn_data.rate_wait)
LOG.debug("[%x] API cluster proxy %s %s to %s "
"with %s. Waited conn: %2.4f, rate: %2.4f",
id(conn), proxy_for.upper(), uri, url,
kwargs_copy, conn_data.conn_wait,
conn_data.rate_wait)
# call the actual connection method to do the
# http request/response over the wire
@ -799,7 +800,7 @@ class ClusteredAPI(object):
return response
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
if exc_config.should_ground_endpoint(e):
# consider endpoint inaccessible and move to next

Loading…
Cancel
Save