Skip to content

Added systemd oom handling and tests#227

Merged
mishushakov merged 10 commits intomainfrom
systemd-oom-restart
Mar 23, 2026
Merged

Added systemd oom handling and tests#227
mishushakov merged 10 commits intomainfrom
systemd-oom-restart

Conversation

@mishushakov
Copy link
Member

@mishushakov mishushakov commented Mar 18, 2026

Note

Medium Risk
Changes the template’s startup/process supervision to rely on systemd for restarting Jupyter and the uvicorn server, which can affect sandbox boot and recovery behavior. Adds kill/restart integration tests that may be timing-sensitive in CI.

Overview
Switches the non-docker template to run Jupyter and the code-interpreter API as systemd services with Restart=on-failure, service dependency wiring, and a shared Jupyter readiness pre-check via the new jupyter-healthcheck.sh.

Updates template.py to install the new unit files and start via systemctl (while keeping the docker path using start-up.sh), and adds JS + Python (sync/async) tests that kill -9 Jupyter or uvicorn and assert the /health endpoint and code execution recover after restart.

Written by Cursor Bugbot for commit dc0d06d. This will update automatically on new commits. Configure here.

@mishushakov mishushakov self-assigned this Mar 18, 2026
@mishushakov mishushakov marked this pull request as ready for review March 18, 2026 16:11
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Copy link
Member

@jakubno jakubno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably set StartLimitBurst

Systemd's default rate limit is 5 starts in 10 seconds. A crash loop exhausts this and puts the unit in failed state permanently with no self-recovery.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@mishushakov mishushakov requested a review from jakubno March 20, 2026 17:29
@ValentaTomas ValentaTomas removed their request for review March 21, 2026 06:41
Copy link
Member

@jakubno jakubno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one nit JUPYTER_CONFIG_PATH can be defined only for Docker in template.py

@mishushakov mishushakov merged commit a7c8922 into main Mar 23, 2026
18 of 20 checks passed
@mishushakov mishushakov deleted the systemd-oom-restart branch March 23, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants