From 850a192bcb393e74ea6842ad2d04e2f3997353e8 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 22 Aug 2017 15:30:09 +0200 Subject: [PATCH] add a timeout to artifact resolve HTTP calls (fixes #18098) --- mellon/app_settings.py | 1 + mellon/views.py | 1 + 2 files changed, 2 insertions(+) diff --git a/mellon/app_settings.py b/mellon/app_settings.py index a84f8c5..aeeab73 100644 --- a/mellon/app_settings.py +++ b/mellon/app_settings.py @@ -35,6 +35,7 @@ class AppSettings(object): 'TRANSIENT_FEDERATION_ATTRIBUTE': None, 'LOGIN_URL': 'mellon_login', 'LOGOUT_URL': 'mellon_logout', + 'ARTIFACT_RESOLVE_TIMEOUT': 10.0, } @property diff --git a/mellon/views.py b/mellon/views.py index 40fd2bf..e7dc04c 100644 --- a/mellon/views.py +++ b/mellon/views.py @@ -260,6 +260,7 @@ class LoginView(ProfileMixin, LogMixin, View): try: result = requests.post(login.msgUrl, data=login.msgBody, headers={'content-type': 'text/xml'}, + timeout=app_settings.ARTIFACT_RESOLVE_TIMEOUT, verify=verify_ssl_certificate) except RequestException, e: self.log.warning('unable to reach %r: %s', login.msgUrl, e)