From fba94caaacba4404b491489532c4ba9aca245612 Mon Sep 17 00:00:00 2001 From: Tim McCormack Date: Thu, 13 Mar 2025 20:54:45 +0000 Subject: [PATCH] docs: Document the PROXY setting and why you would want to use it I just grabbed the commit message for f4cb95bb2bdb819cde/PR #36. I haven't actually verified whether this is still accurate -- note that this is from 2015, written for Python 2. For all I know this performance concern is no longer relevant. It also may not be relevant for codejail-service, which is a much smaller process than edxapp. --- codejail/proxy.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/codejail/proxy.py b/codejail/proxy.py index 7e82a94c..98b27e4b 100644 --- a/codejail/proxy.py +++ b/codejail/proxy.py @@ -1,4 +1,19 @@ -"""A proxy subprocess-making process for CodeJail.""" +""" +A proxy subprocess-making process for CodeJail. + +When spawning subprocesses, fork() will fail if the memory of the parent +can't be duplicated in the child. This means large long-lived processes +will have problems using CodeJail repeatedly. + +This introduces a long-lived proxy subprocess which then spawns the +actual subprocesses. Because the proxy process starts small and stays +small, it will be able to spawn subprocesses even when the parent +process grows large. + +The use of the proxy process is controlled by a "PROXY" limit, which +should be 0 or 1. If neither is set, then the CODEJAIL_PROXY +environment variable determines whether the proxy is used. +""" import ast import logging