Skip to content

fix: forward cancellation token to toolkit installer subprocesses#409

Open
sLightlyDev wants to merge 1 commit into
mainfrom
marko/sal-105-hanging-kernel-cant-be-cancelled
Open

fix: forward cancellation token to toolkit installer subprocesses#409
sLightlyDev wants to merge 1 commit into
mainfrom
marko/sal-105-hanging-kernel-cant-be-cancelled

Conversation

@sLightlyDev

@sLightlyDev sLightlyDev commented Jun 9, 2026

Copy link
Copy Markdown

Problem

The pip/venv processService.exec calls in the Deepnote toolkit installer were started without the CancellationToken. Cancellation was only checked between calls, so cancelling during a multi-minute pip install did nothing until the install finished — the Stop button appeared dead.

Fix

Pass the token into every exec call in deepnoteToolkitInstaller.node.ts (and thread it through isToolkitInstalled). The process layer already wires token.onCancellationRequested to kill the subprocess, so cancelling now terminates the running install immediately.

Testing

  • Added unit tests asserting the token is forwarded to exec
  • Full unit suite green (2333 passing, 0 failing)
  • tsc clean
  • Verified manually in the Extension Development Host: with a fresh environment install running, clicking Cancel now stops it within ~1–2s (pip output halts immediately)

Opened as draft pending review.

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced cancellation support for deepnote toolkit setup operations, ensuring cancellation requests are properly handled throughout all installation steps.
  • Tests

    • Added test coverage for cancellation handling in toolkit installation workflows.

The pip/venv exec calls in the Deepnote toolkit installer were started without the CancellationToken, so cancellation was only checked between calls. Cancelling during a multi-minute pip install did nothing until the install finished, leaving the Stop button unresponsive.

Pass the token into every processService.exec call (and thread it through isToolkitInstalled) so cancelling now terminates the running subprocess immediately.
@linear-code

linear-code Bot commented Jun 9, 2026

Copy link
Copy Markdown

SAL-105

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0%. Comparing base (cd1a571) to head (39a1e41).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #409   +/-   ##
===========================
===========================
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f5ea616a-3807-4c64-93e8-ed7cb0b0cc0f

📥 Commits

Reviewing files that changed from the base of the PR and between cd1a571 and 39a1e41.

📒 Files selected for processing (2)
  • src/kernels/deepnote/deepnoteToolkitInstaller.node.ts
  • src/kernels/deepnote/deepnoteToolkitInstaller.unit.test.ts

📝 Walkthrough

Walkthrough

This PR adds cancellation-token propagation to all subprocess executions in the deepnote-toolkit installer. The isToolkitInstalled helper now accepts an optional token parameter, and all installation methods (installAdditionalPackages, installVenvAndToolkit, installToolkitPackages, installKernelSpec) forward the token to their subprocess calls via processService.exec options. Tests verify token forwarding in package installation and validate that no subprocess call occurs when the package list is empty.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Updates Docs ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: forwarding cancellation tokens to toolkit installer subprocess calls, which directly addresses the hanging kernel cancellation issue documented in the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@sLightlyDev sLightlyDev marked this pull request as ready for review June 9, 2026 13:36
@sLightlyDev sLightlyDev requested a review from a team as a code owner June 9, 2026 13:36
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.

1 participant