Skip to content

fix: use the proactor event loop policy on Windows in edit-mode runtimes#9194

Merged
akshayka merged 4 commits intomainfrom
aka/fix-windows-event-loop
Apr 17, 2026
Merged

fix: use the proactor event loop policy on Windows in edit-mode runtimes#9194
akshayka merged 4 commits intomainfrom
aka/fix-windows-event-loop

Conversation

@akshayka
Copy link
Copy Markdown
Contributor

@akshayka akshayka commented Apr 14, 2026

This change updates the kernel to use the Proactor event loop in Windows in edit mode, partially fixing #9182.

Before this change, the kernel process inherited the event loop policy of the server process (which is the selector policy, because we use the add_reader API).

This is only a partial fix because it doesn't address when the kernel runs in-process (marimo run notebook.py). We could maybe change the event loop policy even in the in-process situation, but we would have to double check that doing so wouldn't break the server as a side-effect.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Apr 16, 2026 9:17pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the kernel subprocess startup path to use the Windows Proactor event loop policy (instead of inheriting the server’s Selector policy), enabling asyncio subprocess APIs (e.g., asyncio.create_subprocess_exec) to work in Windows edit-mode kernels.

Changes:

  • Force WindowsProactorEventLoopPolicy for kernel subprocesses on Windows to support asyncio subprocess features.

Comment thread marimo/_runtime/runtime.py Outdated
Comment thread marimo/_runtime/runtime.py Outdated
Copy link
Copy Markdown
Contributor

@mscolnick mscolnick left a comment

Choose a reason for hiding this comment

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

could we add a test that this gets set in a test? or prevent someone from accidentally removing this code path.

mscolnick
mscolnick previously approved these changes Apr 16, 2026
@mscolnick
Copy link
Copy Markdown
Contributor

@akshayka tests are currently failing:

FAILED tests/_runtime/test_runtime.py::TestLaunchKernelEventLoop::test_windows_pre_314_installs_proactor_event_loop_policy - NameError: name 'windows_events' is not defined
FAILED tests/_runtime/test_runtime.py::TestLaunchKernelEventLoop::test_run_mode_on_windows_does_not_touch_event_loop_policy - NameError: name 'windows_events' is not defined

@akshayka akshayka added the bash-focus Area to focus on during release bug bash label Apr 17, 2026
@akshayka akshayka merged commit e0e76a9 into main Apr 17, 2026
69 of 81 checks passed
@akshayka akshayka deleted the aka/fix-windows-event-loop branch April 17, 2026 03:00
@github-actions
Copy link
Copy Markdown

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.2-dev41

akshayka added a commit that referenced this pull request Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bash-focus Area to focus on during release bug bash bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants