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)

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

* Black formatting
  • Loading branch information
afabiani authored Mar 20, 2023
1 parent f887a20 commit bf21b65
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion geonode/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,12 @@ def request(
_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:
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 bf21b65

Please sign in to comment.