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

Allow client classes to be safely constructed in concurrent environments #127

Merged
merged 2 commits into from
Aug 10, 2023

Conversation

Nevett
Copy link
Contributor

@Nevett Nevett commented Aug 9, 2023

The UrlProvider internal cache was not thread safe when being accessed for the first time for a given data center key.

Attempting to construct client classes in concurrent environments would risk an exception being thrown, if two threads attempt to initialize the same key.

System.ArgumentException: An item with the same key has already been added.

This change makes this safe.

@Nevett Nevett merged commit 57a33f2 into master Aug 10, 2023
1 check passed
@danieltallentire danieltallentire deleted the concurrent-construction branch October 9, 2023 09:15
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.

2 participants