Skip to content

Windows Tokio Runtime Panic: "no reactor running" #1

Open

Description

@Gioee

The SQLite MCP extension fails tests on Windows with a Tokio runtime panic: "there is no reactor running, must be called from the context of a Tokio 1.x runtime". This occurs specifically when the rmcp library performs nested tokio::spawn() calls within the async service handlers.

Root Cause: Windows IOCP (I/O Completion Ports) enforces stricter runtime context requirements than Unix platforms (Linux/macOS).

Attempted Solutions:
- Single global runtime with runtime.enter()
- Current-thread runtime to avoid worker thread issues
- Background worker thread architecture
- Explicit runtime context propagation
- Various spawn/block_on pattern modifications

Current Status: Development on this issue is paused.

Workaround: Windows tests are temporarily skipped in CI/CD workflows until a permanent solution is implemented. The extension works correctly on all Unix-based platforms.

This issue is linked with the fix-windows-tokio-issue branch.

Activity

  1. self-assigned this
    on Dec 18, 2025
  2. added
    bug
    on Dec 18, 2025
  3. JustVugg commented on May 19, 2026

    @JustVugg

    I looked into this and I think the panic is caused by nested tokio::spawn() calls being reached from sqlite-mcp’s sync FFI boundary.

    Tokio requires tokio::spawn() to run from inside the context of a Tokio runtime. On Windows this becomes more visible because the IO reactor is stricter, so a nested spawn from a callback/transport path can panic with:

    there is no reactor running, must be called from the context of a Tokio 1.x runtime

    I’m preparing a small PR that captures a tokio::runtime::Handle while definitely inside the runtime and uses handle.spawn(...) instead of relying on implicit tokio::spawn(...) in the nested rmcp paths.

    This should be a minimal fix before considering a larger runtime/actor refactor for the SQLite FFI boundary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions