Skip to content

bug: generate_from_raw hanging when ollama under load #650

Description

@psschwei

In the process of testing #567 I encountered an issue where test/core/test_component_typing.py::test_generating was timing out after 15 minutes and failing. Seems like I had overloaded ollama by running for i in {1..10}; do uv run pytest test/core -v; done and the test failed on the fourth or fifth run.

Doing a little bit of digging, it seems like the issue happened here:

responses = await asyncio.gather(*coroutines, return_exceptions=True)

Because there's no timeout, if Ollama stalls on any of the concurrent requests (like it seems happened when I ran this test over and over and over again) the entire call hangs indefinitely.

There's a couple of different ways we could fix this, but probably the easiest would be to set a timeout on the underlying ollama.AsyncClient:

_async_client = ollama.AsyncClient(self._base_url)

Ideally we'd make the timeout configurable too (so users could set it when creating the backend?)

Activity

  1. psschwei commented on Mar 13, 2026

    @psschwei
    ContributorAuthor

    Looks like @planetf1 may have already reported this in #599 (though they might be slightly different?)

  2. LuminoNectar commented on Mar 17, 2026

    @LuminoNectar

    I would like to tackle this bug! Can this be assigned to me?

  3. psschwei commented on May 8, 2026

    @psschwei
    ContributorAuthor

    Hi @LuminoNectar , are you still planning on working on this?

  4. added
    bug
    good first issue
    help wanted
    and removed
    bug
    on May 12, 2026
  5. added theissue type on May 19, 2026
  6. added
    bug
    on May 19, 2026
  7. self-assigned this
    on May 19, 2026
  8. added
    area/backends
    on May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/backendsbuggood first issuehelp wanted

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions