- Notifications
You must be signed in to change notification settings - Fork32
fix(core): Fix race condition inSyncClient loop init#468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
kurtisvg left a comment
There was a problem hiding this 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?
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.
e71b6eb toc61a8faCompareanubhav756 commentedDec 18, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
It looks like the user is indeed using multi-threading here. Their stack trace shows usage of Since they are multi-threading, the GIL unfortunately doesn't protect us here. Thoughts? |
Fixes a race condition in
ToolboxSyncClientwhere multiple threads could initialize separate event loops, causingaiohttpto raiseRuntimeError.This change adds a thread lock to ensure the shared background event loop is initialized exactly once.
Fixes#428