Repository navigation
Explain why the sandbox stopped when its process is killed - #51
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eliotwrobson
marked this pull request as ready for review
November 18, 2026 21:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When student code used too much memory, the container's memory limit killed the sandbox process, and the student saw "Connection closed by peer before termination character was found." This was reported against the legacy grader in PrairieLearn issue 5083, and it applies here too.
Now, when the sandbox closes the connection, the grader waits up to a second for its process to exit and says why it stopped:
SIGKILL, which is what memory limits do: "The sandbox running your code was killed, probably because your code used too much memory."Later queries on the same sandbox, such as with
module_sandbox, get the same message.If the memory limit kills the grader's own pytest process instead, there's still no results file, and PrairieLearn shows its generic message. In my runs, the sandbox was killed every time, because it's the process using the memory.
Testing
In the grader image with
docker run --memory=300m, student code that keeps allocating memory got the new message in 3 of 3 runs.🤖 Generated with Claude Code