Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review thread safety of client/API/Evaluation context #96

Open
1 task
Tracked by #2
toddbaert opened this issue Apr 18, 2023 · 3 comments
Open
1 task
Tracked by #2

Review thread safety of client/API/Evaluation context #96

toddbaert opened this issue Apr 18, 2023 · 3 comments
Labels
1.0-release Required for a 1.0 release
Milestone

Comments

@toddbaert
Copy link
Member

toddbaert commented Apr 18, 2023

Review the thread safety of the SDK to make sure there's no potential concurrency issues, particularly around state maintained in the global API object, clients, and evaluation context objects.

See here for a similar discussion in the Java SDK and others.

Definition of done:

  • issues created for thread safety of global API, client, and evaluation context.
@toddbaert toddbaert mentioned this issue Apr 18, 2023
14 tasks
@toddbaert toddbaert changed the title review thread safety of client/API/Evaluation context Review thread safety of client/API/Evaluation context Apr 18, 2023
@toddbaert toddbaert added the 1.0-release Required for a 1.0 release label Apr 18, 2023
@toddbaert
Copy link
Member Author

@matthewelwell @hlipsig @tcarrio do we need to worry about locking/concurrency here? I know there's a threading module in Python. Are any locks necessary, especially around global state? From our meeting if sounds like this might not be necessary, but I have limited Python experience and can't say...

@beeme1mr
Copy link
Member

Hey @federicobond perhaps you could answer this question. Do we need to be concerned about threading issues?

@federicobond
Copy link
Member

I'd have to take a closer look at it. The GIL has us covered in some cases for simple assignments but anything more complex than that should probably be guarded by a lock.

add_hooks is probably not thread-safe due to read-update-write race conditions when concatenating lists.

set_provider used to be thread safe but likely isn't now with the new shutdown and initialize logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0-release Required for a 1.0 release
Projects
None yet
Development

No branches or pull requests

3 participants