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

Put an async lock around updating OrderCloudClient.TokenResponse #21

Open
tmenier opened this issue May 7, 2018 · 1 comment
Open

Comments

@tmenier
Copy link
Contributor

tmenier commented May 7, 2018

Authenticate() might not be threadsafe as is, or at the very least multiple threads could be authenticating and the same time and overwriting each other's results, which is not necessarily harmful but is a bit of a waste.

Possibly use a SemaphorSlim.

@tmenier tmenier added this to the 0.7.0 milestone May 7, 2018
@tmenier tmenier removed this from the 0.7.0 milestone Apr 13, 2020
@tmenier
Copy link
Contributor Author

tmenier commented Aug 30, 2022

The main thread-safety concern was in the logic that automatically authenticates and refreshes tokens when necessary. This was updated in #97 to use async locking, which should cover the majority of auth scenarios. Per the docs, "there should be very few use cases where [manually authenticating] is necessary", so although technically this issue isn't fixed, the cases where it could come up are far fewer.

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

No branches or pull requests

1 participant