From 47873acec2643227b13a4b3db4e6005aa778173e Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Mon, 23 Sep 2024 09:03:48 -0500 Subject: [PATCH] fix: uwsgi closed connection --- .../20240903_140541_crisgarta8_closed_connection.md | 1 + tutor/templates/build/openedx/settings/uwsgi.ini | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 changelog.d/20240903_140541_crisgarta8_closed_connection.md diff --git a/changelog.d/20240903_140541_crisgarta8_closed_connection.md b/changelog.d/20240903_140541_crisgarta8_closed_connection.md new file mode 100644 index 0000000..799b401 --- /dev/null +++ b/changelog.d/20240903_140541_crisgarta8_closed_connection.md @@ -0,0 +1 @@ +[Improvement] Fixes an issue which caused 502 errors by a premature closed connection by uwsgi, it also improves the handling of SIGTERM in docker and other uwsgi improvements (by @Ian2012). \ No newline at end of file diff --git a/tutor/templates/build/openedx/settings/uwsgi.ini b/tutor/templates/build/openedx/settings/uwsgi.ini index a716d48..d612bd2 100644 --- a/tutor/templates/build/openedx/settings/uwsgi.ini +++ b/tutor/templates/build/openedx/settings/uwsgi.ini @@ -8,3 +8,16 @@ processes = $(UWSGI_WORKERS) thunder-lock = true single-interpreter = true enable-threads = true +# Fix 502 errors for closed connections +http-keepalive = 1 +add-header = Connection: Keep-Alive +# Better startup/shutdown in docker: +die-on-term = true +lazy-apps = false +need-app = true +no-defer-accept = true +# Enable the master process for performance +master = true +# Clean up settings +py-call-osafterfork = true +vacuum = true