Skip to content

Added supervisord to survive process restart#219

Open
mishushakov wants to merge 17 commits intomainfrom
jupyter-supervisord
Open

Added supervisord to survive process restart#219
mishushakov wants to merge 17 commits intomainfrom
jupyter-supervisord

Conversation

@mishushakov
Copy link
Member

@mishushakov mishushakov commented Mar 12, 2026

Note

Medium Risk
Changes the container/service startup and supervision model, which can affect sandbox availability and restart behavior if misconfigured. Added end-to-end tests mitigate risk but failures could still impact runtime stability.

Overview
Replaces the previous start-up.sh flow with supervisord, introducing supervisord.conf plus dedicated start-jupyter.sh/start-code-interpreter.sh wrappers (including a PID file and a “wait for Jupyter ready” gate) so both services are automatically restarted together.

Updates the template build to install supervisor and ship the new scripts/config, and adds JS + Python (sync/async) integration tests that forcibly kill -9 Jupyter or the code-interpreter process and assert /health and code execution recover.

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

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c36ff2959f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

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.

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


# Jupyter exited — kill code-interpreter so supervisord restarts both
echo "Jupyter exited, killing code-interpreter..."
kill "$(cat /var/run/code-interpreter.pid)" 2>/dev/null
Copy link

Choose a reason for hiding this comment

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

Unguarded PID file read may produce spurious errors

Low Severity

The kill "$(cat /var/run/code-interpreter.pid)" 2>/dev/null command doesn't check if the PID file exists before reading it. The 2>/dev/null only suppresses kill's stderr, not cat's. If Jupyter exits before code-interpreter has written its PID file (e.g., very early crash on first startup), cat emits an unhandled error to stderr (visible in supervisord logs), and kill receives an empty-string argument. Adding a file-existence guard (e.g., wrapping in [ -f ... ] &&) would make this robust.

Fix in Cursor Fix in Web

@ValentaTomas
Copy link
Member

As we already have systemd inside of the sandbox, don't we want to use that for this too?

@ValentaTomas ValentaTomas removed their request for review March 12, 2026 22:57
@mishushakov
Copy link
Member Author

@ValentaTomas but then it's impossible to test code interpreter locally

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