Skip to content

Conversation

@anubhav756
Copy link
Contributor

Fixes a race condition in ToolboxSyncClient where multiple threads could initialize separate event loops, causing aiohttp to raise RuntimeError.

This change adds a thread lock to ensure the shared background event loop is initialized exactly once.

Fixes #428

Fixes a race condition in ToolboxSyncClient where multiple threads could initialize separate event loops, causing aiohttp to raise RuntimeError.

This change adds a thread lock to ensure the shared background event loop is initialized exactly once.
Copy link
Contributor

@kurtisvg kurtisvg left a comment

Choose a reason for hiding this comment

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

Somewhat concerned -- how did we hit this race condition? Doesn't the GIL prevent us from having to use a lock unless someone is multi-threading?

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.

Runtime error Timeout context manager should be used inside a task

2 participants