Skip to content

Commit

Permalink
[Fixes #10790] GeoNode "HttpClient" not catching the Connection Timeo… (
Browse files Browse the repository at this point in the history
#10791) (#10806)

* [Fixes #10790] GeoNode "HttpClient" not catching the Connection Timeout and therefore causes UWSGI to die

* Black formatting

(cherry picked from commit bf21b65)

# Conflicts:
#	geonode/utils.py
  • Loading branch information
afabiani authored Mar 20, 2023
1 parent c1b4c33 commit f8f6799
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions geonode/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1193,14 +1193,13 @@ def request(self, url, method='GET', data=None, headers={}, stream=False,
if action:
_req_tout = timeout or self.timeout
try:
response = action(
url=url,
data=data,
headers=headers,
timeout=_req_tout,
stream=stream,
verify=verify)
except (requests.exceptions.RequestException, ValueError, RetryError) as e:
response = action(url=url, data=data, headers=headers, timeout=_req_tout, stream=stream, verify=verify)
except (
requests.exceptions.ConnectTimeout,
requests.exceptions.RequestException,
ValueError,
RetryError,
) as e:
msg = f"Request exception [{e}] - TOUT [{_req_tout}] to URL: {url} - headers: {headers}"
logger.exception(Exception(msg))
response = None
Expand Down

0 comments on commit f8f6799

Please sign in to comment.