-
Notifications
You must be signed in to change notification settings - Fork 219
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
Update locking and caching for OpenIdConnectCachingSecurityTokenProvider
#3124
base: master
Are you sure you want to change the base?
Update locking and caching for OpenIdConnectCachingSecurityTokenProvider
#3124
Conversation
There's this comment from the other PR: #3118 (comment) |
@mderriey not sure if you saw this ^ |
I did, yes, I replied further down in the thread. Alex's comments make sense to me, but I can't comment on whether they're better than what's in this PR. I opened this PR with the goal of potentially helping other people as much as getting some validation on the changes we've been running in production. As mentioned in the PR description, I now consider this PR yours. I'm happy to contribute my thoughts, but I won't push in one direction or the other as I wouldn't be confident in my knowledge or experience when it comes to multithreading, thread synchronisation, or locking. |
…3202) * Remove explicit locking in OpenIdConnectCachingSecurityTokenProvider Fixes #3078 See #3124 and #3118 for more context. * Simplify OpenIdConnectCachingSecurityTokenProvider --------- Co-authored-by: Keegan Caruso <[email protected]>
Update locking and caching for
OpenIdConnectCachingSecurityTokenProvider
Update locking and caching for
OpenIdConnectCachingSecurityTokenProvider
Description
This is a proposed alternative to #3118.
Changes:
Interlocked.Exchange
to ensure a single thread callsConfigurationManager.GetConfigurationAsync
at a time.Thanks for offering me to open a PR for this.
Please get as many eyes as you can on this to validate my assumptions. I don't have much confidence in my multi-threading, locking, and synchronization abilities.
Also, feel free to take over that PR to adjust to your coding preferences; one thing I noticed is the code base seems to prefer using
Interlocked.CompareExchange
overInterlocked.Exchange
.Essentially, this is now yours, although I'll definitely keep an eye on it and answer questions where I can.
Fixes #3078