Catch connection errors and count them as failures
Previously we'd get tracebacks like this during a proxy reload: Traceback (most recent call last): File ".../urllib3/connectionpool.py", line 791, in urlopen response = self._make_request( File ".../urllib3/connectionpool.py", line 537, in _make_request response = conn.getresponse() File ".../urllib3/connection.py", line 461, in getresponse httplib_response = super().getresponse() File ".../http/client.py", line 1375, in getresponse response.begin() File ".../http/client.py", line 318, in begin version, status, reason = self._read_status() File ".../http/client.py", line 287, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File ".../requests/adapters.py", line 486, in send resp = conn.urlopen( File ".../urllib3/connectionpool.py", line 845, in urlopen retries = retries.increment( File ".../urllib3/util/retry.py", line 470, in increment raise reraise(type(error), error, _stacktrace) File ".../urllib3/util/util.py", line 38, in reraise raise value.with_traceback(tb) File ".../urllib3/connectionpool.py", line 791, in urlopen response = self._make_request( File ".../urllib3/connectionpool.py", line 537, in _make_request response = conn.getresponse() File ".../urllib3/connection.py", line 461, in getresponse httplib_response = super().getresponse() File ".../http/client.py", line 1375, in getresponse response.begin() File ".../http/client.py", line 318, in begin version, status, reason = self._read_status() File ".../http/client.py", line 287, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File ".../eventlet/greenpool.py", line 88, in _spawn_n_impl func(*args, **kwargs) File ".../swiftbench/bench.py", line 477, in _run client.get_object(self.url, self.token, File ".../swiftclient/client.py", line 1252, in get_object conn.request(method, path, '', headers) File ".../swiftclient/client.py", line 416, in request self.resp = self._request(method, url, headers=headers, data=data, File ".../swiftclient/client.py", line 400, in _request return self.request_session.request(*arg, **kwarg) File ".../requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File ".../requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File ".../requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) Change-Id: Idd1a83afd2c4dbf7305c19d3ec3974961e500620
This commit is contained in:
parent
5f803ae8fd
commit
e8eb9511d2
@ -32,6 +32,7 @@ import eventlet
|
||||
import eventlet.pools
|
||||
from eventlet.green.httplib import CannotSendRequest
|
||||
|
||||
import requests.exceptions
|
||||
import six
|
||||
from six.moves import range
|
||||
|
||||
@ -65,7 +66,8 @@ def delete_containers(logger, conf):
|
||||
def _deleter(url, token, container):
|
||||
try:
|
||||
client.delete_container(url, token, container)
|
||||
except client.ClientException as e:
|
||||
except (client.ClientException,
|
||||
requests.exceptions.ConnectionError) as e:
|
||||
if e.http_status != HTTP_CONFLICT:
|
||||
logger.warn("Unable to delete container '%s'. "
|
||||
"Got http status '%d'."
|
||||
@ -452,7 +454,8 @@ class BenchDELETE(Bench):
|
||||
direct_client.direct_delete_object(node, partition,
|
||||
self.account,
|
||||
container_name, name)
|
||||
except client.ClientException as e:
|
||||
except (client.ClientException,
|
||||
requests.exceptions.ConnectionError) as e:
|
||||
self.logger.debug(str(e))
|
||||
self.failures += 1
|
||||
self.complete += 1
|
||||
@ -481,7 +484,8 @@ class BenchGET(Bench):
|
||||
direct_client.direct_get_object(node, partition,
|
||||
self.account,
|
||||
container_name, name)
|
||||
except client.ClientException as e:
|
||||
except (client.ClientException,
|
||||
requests.exceptions.ConnectionError) as e:
|
||||
self.logger.debug(str(e))
|
||||
self.failures += 1
|
||||
self.complete += 1
|
||||
@ -525,7 +529,8 @@ class BenchPUT(Bench):
|
||||
container_name, name,
|
||||
source,
|
||||
content_length=len(source))
|
||||
except client.ClientException as e:
|
||||
except (client.ClientException,
|
||||
requests.exceptions.ConnectionError) as e:
|
||||
self.logger.debug(str(e))
|
||||
self.failures += 1
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user