Skip to content

Switch kernel launch to IPC transport (supersedes #1772) #1813

@rgbkrk

Description

@rgbkrk

Replace the current port-reservation-based kernel launch (which has a TOCTOU race around port reuse — the original #1772 issue) with IPC transport (Unix domain sockets / named pipes) for the kernel's Jupyter control/shell/iopub/stdin/heartbeat channels.

Why now

  • The TCP port-retry dance is fragile: we pick a port, kernel may bind late, port collisions cause silent failures or require restart.
  • IPC sockets have no port namespace collision surface.
  • jupyter_client supports IPC transport (transport: "ipc") — kernel-side wiring is minimal.
  • Aligns with runtimed-agent architecture (already Unix-socket based).

Work

  1. Design spec: what exactly do we change in kernel-launch, JupyterKernel, and the connection-info JSON written to disk? Where do the 5 IPC socket files live (daemon base dir? worktree-scoped?)?
  2. Implementation in crates/kernel-launch + crates/runtimed/src/jupyter_kernel.rs.
  3. Per-kernel cleanup: socket files need to be removed on kernel shutdown AND orphan-reaped by process_groups if the kernel crashes.
  4. Windows story: jupyter_client's IPC support uses named pipes — verify it works or keep TCP for Windows.

Scope gate

Prerequisite: confirm ipykernel honors transport: ipc on all supported Python versions. If there's any gap, falls back to TCP there.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions