Repository navigation
fix(jupyter-notebook): close servers that finish launching during shutdown - #148
Open
JunkaiWang-TheoPhy wants to merge 1 commit into
Open
JunkaiWang-TheoPhy wants to merge 1 commit into
JunkaiWang-TheoPhy wants to merge 1 commit into
Conversation
Closing only registered entries misses an owned process whose launch is still in flight. Close admission, drain the pending launch, and share one cleanup promise while keeping attached servers outside plugin ownership. Confidence: high Scope-risk: narrow Tested: Old registry fails four unit regressions and a real Jupyter process regression; fixed49 unit and15 real integration tests; MCP smoke, AppBridge E2E, types and lint Not-tested: Current native Desktop install remains incomplete; unrelated full build requires missing rustup
JunkaiWang-TheoPhy
requested review from
jacksonliuyn and
panda920
as code owners
November 1, 2026 00:56
Collaborator
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
This branch has not been deployed
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.
Plugin type (required) / 插件类型(必填)
Affected plugin:
jupyter-notebook.What
Closing the plugin while
start_serveris still starting Jupyter can leave a running server outside the registry:closeAll()previously inspected only registered entries, returned, and the pending launch subsequently registered its process. Closing twice could also stop the same owned server twice.Make registry closure terminal and share its cleanup promise. Shutdown waits for the pending launch; that launch stops its newly obtained process if shutdown has already begun, rather than registering a ready server. In-flight and new attachments cannot repopulate a closed registry. Existing attached servers remain external and are not stopped.
Bump the plugin, marketplace, source package and protocol version from 0.2.0 to 0.2.1, with synchronized English/Chinese docs. No new dependencies, permissions or network services are added. Existing Jupyter process execution and notebook access are unchanged.
Verification
On upstream
0cc58d6aa29644f50af1d7ac2fa4c4eb7ada95d9, preserving the new tests and restoring only the old registry:The latter uses a real Jupyter process: it remains alive after the old closeAll returns. Cleanup in the test still stops that process.
With the fix:
Environment: macOS arm64, Node 24.15.0, pnpm 10.33.2, Vitest 4.1.4, Python 3.12.13, Jupyter Server 2.21.1, ipykernel 7.4.0.
Outstanding validation
Full repository build stops in the unrelated photocraft snapshot because rustup is unavailable; full distribution packaging then rejects that incomplete plugin. Root tests also require unbuilt KiCad artifacts. These failures have not been bypassed or labeled as passing.
Current ZCode Desktop installation verification remains incomplete. The official 3.17.1 macOS arm64 release was integrity-checked and launched with independent runtime/data directories and a restrictive OS sandbox that denies access to production user data. It exited during startup because its telemetry store still targets the denied production Application Support path and Electron sandbox initialization fails in that isolation. Production data access and internal sandbox restrictions were not relaxed. The official AppBridge browser check above is a distinct, passing test surface.
AI disclosure: investigation, implementation and local verification used OpenAI Codex assistance.
Self-check