posit-dev / posit-dev/ark

For Jupyter, `q()` should probably be overridden to error and tell you how to actually shut down the right way

Open
#554 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: jupyter kernel
Dominant language
Rust
Stars
337
Forks
32
Avg merge
8d 17h
Merged PRs (30d)
11

Description

Screenshot 2024-09-30 at 4 46 58 PM

Otherwise R just dies and Jupyter throws warnings that R isn't responding to is_complete_request and friends


We could probably send the ask_exit payload from the kernel -> frontend, telling the frontend to request a shutdown?
https://jupyter-client.readthedocs.io/en/stable/messaging.html#payloads-deprecated

Payloads are deprecated but there is currently no alternative, so I feel like we should just use it for now (its been deprecated for over 9 years...)

It looks like you send it as part of an execute_reply
https://github.com/jupyter/jupyter_console/blob/fddbc42d2e0be85feace1fe783a05e2b569fceae/jupyter_console/ptshell.py#L743-L767

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Jupyter messaging documentation and the referenced jupyter_console/ptshell.py execute_reply handling. Trace how Ark currently handles R's q() in its kernel implementation, then determine whether the deprecated ask_exit payload can request a frontend shutdown. Done means q() no longer leaves the kernel unresponsive and provides the correct shutdown behavior or guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter, r, rust
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.