diff --git a/elasticsearch/connection/http_urllib3.py b/elasticsearch/connection/http_urllib3.py index c58944e96..9d78c9185 100644 --- a/elasticsearch/connection/http_urllib3.py +++ b/elasticsearch/connection/http_urllib3.py @@ -2,6 +2,7 @@ import ssl import urllib3 from urllib3.exceptions import ReadTimeoutError, SSLError as UrllibSSLError +from urllib3.util.retry import Retry import warnings import gzip @@ -168,7 +169,7 @@ def perform_request(self, method, url, params=None, body=None, timeout=None, ign # again body = gzip.zlib.compress(body) - response = self.pool.urlopen(method, url, body, retries=False, headers=request_headers, **kw) + response = self.pool.urlopen(method, url, body, retries=Retry(False), headers=request_headers, **kw) duration = time.time() - start raw_data = response.data.decode('utf-8') except Exception as e: