Skip to content

fix: scope async SSE client to its event loop - #517

Open
abhinavrastogi2627 wants to merge 1 commit into
conductor-oss:mainfrom
abhinavrastogi2627:fix/async-sse-event-loop
Open

abhinavrastogi2627 wants to merge 1 commit into
conductor-oss:mainfrom
abhinavrastogi2627:fix/async-sse-event-loop

Conversation

@abhinavrastogi2627

Copy link
Copy Markdown

Summary

Fixes #507 by recreating the cached async SSE httpx.AsyncClient when execution moves to a different event loop. This prevents a second asyncio.run(...) call from reusing a transport bound to a closed loop.

Validation

  • pytest tests/unit/orkes/test_orkes_agent_client.py -q (11 passed)
  • python -m compileall -q src/conductor/client/orkes/orkes_agent_client.py tests/unit/orkes/test_orkes_agent_client.py
  • git diff --check

The regression test verifies that sequential event loops receive distinct cached SSE clients.

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.

Async SSE client reuses httpx.AsyncClient across event loops -> "Event loop is closed"

1 participant