From 25be88932c27a4f714a0d2024469f59cb1c89435 Mon Sep 17 00:00:00 2001 From: stv Date: Wed, 20 Feb 2019 11:36:27 -0800 Subject: [PATCH] Handle out-of-memory exception on Sysadmin Courses We've been running into OoM issues with this functionality while executing on one of our smaller application servers. - Sometimes this manifests by preventing the entire page from loading (exception during the GET). - At others, it occurs using the `Delete course from site` functionality by breaking during the POST handler. This case is particularly frustrating because the course actually is deleted, but looks like it may not have been. Internally, this is because the 500 error occurs _after_ the course has been successfully deleted, though this is opaque to the end-user. While this doesn't address the underlying memory issue, it does at least allow the app to recover gracefully. --- lms/djangoapps/dashboard/sysadmin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lms/djangoapps/dashboard/sysadmin.py b/lms/djangoapps/dashboard/sysadmin.py index a63cea5863..e42a9ac6de 100644 --- a/lms/djangoapps/dashboard/sysadmin.py +++ b/lms/djangoapps/dashboard/sysadmin.py @@ -358,6 +358,8 @@ class Courses(SysadminDashboardView): info = [output_json['commit'], output_json['date'], output_json['author'], ] + except OSError as error: + log.warning(text_type(u"Error fetching git data: %s - %s"), text_type(cdir), text_type(error)) except (ValueError, subprocess.CalledProcessError): pass