Repository navigation
Make kernel exit properly when iopub port is already in use - #1594
Merged
Merged
Conversation
krassowski
marked this pull request as ready for review
November 9, 2026 11:13
jtpio
pushed a commit
to jupyterlab/jupyterlab
that referenced
this pull request
Nov 9, 2026
## References Addresses flaky tests from the reports in #19153, such as "Open menu item Kernel" on #19253. The port collision is well documented and a long-standing issue: - jupyter/jupyter_client#487 - I opened an issue and a PR for the ipykernel side but that only addresses recovery - ipython/ipykernel#1593 - ipython/ipykernel#1594 - also note jupyter/jupyter_client#1158 > In recent 171 UI Tests runs (Thursday-Friday), the TCP conflict made: > - "Open menu item Kernel", > - "Export Notebook › Slides", and > - "should always show a prompt and a source line of the same cell" > > fail their first attempt. ## Code changes - Runs the kernels of the UI test server over IPC instead of TCP (when pyzmq is built with support for it). ## Developer-facing changes Tests no longer fail when another kernel binds a port of a new kernel before the new kernel does. Locally, I tested this fix by simulating takeover of the iopub port of every kernel after the server picked it, as in two of these failures. The numbers count failed tests out of the 12 "Notebook Create" tests: | Local setup used for reproduction | `main` | This PR | | -------------------------------------------------------- | ------- | ------- | | iopub port of each kernel taken before the kernel starts | 9 of 12 | 0 of 12 | ## Backwards-incompatible changes None ## AI usage - **YES**: Some or all of the content of this PR was generated by AI. - **YES**: The human author has carefully reviewed this PR and run this code (keep this PR "draft" until the answer is YES) - AI tools and models used: Claude Code (Opus 5.5, max effort)
JohanMabille
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.