Skip to content

fetch_url/fetch_many block the event loop during a fetch (async def + anyio.to_thread.run_sync) #118

Description

@AmirF194

fetch_url and fetch_many in web/crawl4ai_provider.py wrap their async work with a blocking _run_coro helper that joins the thread from the event-loop thread, so the MCP server serves nothing for the duration of a fetch (raised by @jordan-gibbs in #86, follow-up requested there).

Making fetch_url async def and awaiting anyio.to_thread.run_sync directly would keep the server responsive during a fetch. It touches the provider's fetch signature more than #86's scope, which is why it stayed out of that PR.

Not something I've built yet, opening this so it doesn't get lost.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions