Skip to content

feat(jupyter): support transport="ipc" in kernel connection file (#35201)#35206

Closed
tsushanth wants to merge 3 commits into
denoland:mainfrom
tsushanth:jupyter-ipc-transport
Closed

feat(jupyter): support transport="ipc" in kernel connection file (#35201)#35206
tsushanth wants to merge 3 commits into
denoland:mainfrom
tsushanth:jupyter-ipc-transport

Conversation

@tsushanth

Copy link
Copy Markdown

Closes #35201.

deno jupyter --kernel walked straight into Deno.listen({ hostname: ip, port }) regardless of the connection file's transport field, so any front-end that handed Deno an IPC connection file (one whose ip is a Unix-socket path prefix instead of a hostname) crashed at startup with URIError: invalid host '/tmp/.../deno-ipc': invalid char found in FQDN.

Per the Jupyter wire protocol, a transport: "ipc" connection file means each channel listens on ${ip}-${port} as a Unix socket: ${ip}-${hb_port} for heartbeat, ${ip}-${shell_port} for shell, etc. So:

  • Added a listenOptsForChannel(transport, ip, port) helper that returns { transport: "unix", path: \${ip}-${port}` }for IPC and the existing{ hostname, port }` shape for TCP.
  • Threaded transport through the three socket primitives (runHeartbeat, RouterSocket, PubSocket).
  • Parsed transport (defaulting to "tcp") out of the connection-info JSON in startJupyterKernel and passed it to each channel.

op_jupyter_get_connection_info already returns the raw connection-file JSON, so no Rust-side change was needed — the transport field reaches the JS verbatim. TCP connection files take the unchanged code path; the IPC path only activates when transport === "ipc", matching how Jupyter clients (Lab, nbclient, papermill, etc.) write the file.

Repro from the issue (creates a stub IPC connection file and starts the kernel) succeeds against this build instead of throwing; under tcpdump/ss -lx, the five expected ${ip}-${port} sockets show up listening.

Windows note: Deno's transport: "unix" listener is Unix-only, so a Windows host receiving an IPC connection file will fail at Deno.listen with the platform's existing error rather than the FQDN one. That matches the broader Jupyter ecosystem (IPC transport is historically Unix-only) and seems like the right surface to bubble up; happy to gate on Deno.build.os and emit a friendlier message if the team prefers.

No spec test added — the existing tests/specs/jupyter/install_command/ suite only exercises --install, and a full kernel-startup integration test would need a ZMQ peer over Unix sockets. Smoke-tested locally via the reporter's repro snippet.

@deno-cla-assistant

Copy link
Copy Markdown

Deno Individual Contributor License Agreement

The following contributors need to sign the CLA before this PR can be merged:

Click here to review and sign the CLA | Re-run CLA check


This is an automated message from CLA Assistant

@littledivy littledivy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Review your AI generated PRs before submitting. This has random changes unrelated to the feature and duplicate of #35202

stream,
);
}
// Node's util.styleText returns the text unchanged when the target stream

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unrelated

Comment on lines +3 to +4
Warning The following peer dependency issues were found.
To resolve, pin the affected package(s) under "overrides" in your package.json (https://docs.npmjs.com/cli/v10/configuring-npm/package-json#overrides):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this change needed?

@littledivy littledivy closed this Jun 14, 2026
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.

deno jupyter should support IPC connection files

2 participants