From 95e656908f72a0f05f214d37618a3b3c1dfa9508 Mon Sep 17 00:00:00 2001 From: szymon-kuklewicz <30735867+szymon-kuklewicz@users.noreply.github.com> Date: Mon, 4 Nov 2019 14:48:05 +0100 Subject: [PATCH] Improved message for communication interruptions (#189) * Improved message for communication interruptions * Removed unused variable --- neptune/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/neptune/utils.py b/neptune/utils.py index 3c9efb120..745816dfb 100644 --- a/neptune/utils.py +++ b/neptune/utils.py @@ -201,8 +201,9 @@ def wrapper(*args, **kwargs): raise SSLError() except (BravadoConnectionError, BravadoTimeoutError, requests.exceptions.ConnectionError, requests.exceptions.Timeout, - HTTPRequestTimeout, HTTPServiceUnavailable, HTTPGatewayTimeout) as ex: - _logger.warning('Http request to Neptune server failed: %s. Retry in %d seconds.', repr(ex), 2 ** retry) + HTTPRequestTimeout, HTTPServiceUnavailable, HTTPGatewayTimeout): + if retry >= 6: + _logger.warning('Experiencing connection interruptions. Reestablishing communication with Neptune.') time.sleep(2 ** retry) continue except HTTPServerError: