-
Notifications
You must be signed in to change notification settings - Fork 409
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
Xiao/Enrich metadata failure message during metadata refresh interval #2010
Conversation
@@ -148,6 +149,7 @@ public async Task<T> GetConfigurationAsync(CancellationToken cancel) | |||
} | |||
catch (Exception ex) | |||
{ | |||
_fetchMetadataFailure = ex; |
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.
What requires this to be a variable at the class level instead of just a local variable? Seems like there's an oppertunity here for race conditions and I'm not clear on the advantage.
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.
If ConfigurationManager.GetConfigurationAsync is called again before the syncAfter, then the IDX20803 exception at Line 167 gets thrown instead. We need the exception at the class level so that we can return it as the inner exception.
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.
Ok, this seems reasonable to me. Makes sense we wouldn't just want to have the exception in logs the first time from a usibility/servicability standpoint.
test/Microsoft.IdentityModel.Protocols.OpenIdConnect.Tests/ConfigurationManagerTests.cs
Outdated
Show resolved
Hide resolved
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.
LGTM
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [System.IdentityModel.Tokens.Jwt](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet) | nuget | minor | `6.27.0` -> `6.28.1` | --- ### Release Notes <details> <summary>AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet</summary> ### [`v6.28.1`](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases/tag/6.28.1) [Compare Source](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/compare/6.28.0...6.28.1) - Bug fix where internal cache was not instantiated [https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2045](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2045) ### [`v6.28.0`](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases/tag/6.28.0) [Compare Source](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/compare/6.27.0...6.28.0) - Enrich metadata failure message during metadata refresh interval [https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2010](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2010) - Updated fix for controlling depth [https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2024](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2024) - Update Wilson logs with aka.ms pointers to known wikis in [https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2027](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2027) - Fix typo in documentation [https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2034](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2034) - Introduce a LKG configuration cache to store each valid base configuration instead of a single entry of configuration [https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2007](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2007) - Add encryption keys to base configuration [https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2023](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2023) - Updated CHANGELOG link [https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2026](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2026) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 10pm every weekday,every weekend,before 5am every weekday" in timezone Europe/Berlin, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/orso-co/Orso.Arpa.Api). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4zNC4xIiwidXBkYXRlZEluVmVyIjoiMzUuMzQuMSJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Enrich the fetch metadata failure details from its inner exception. That enabled us to distinguish if the error was due to client misconfiguration (e.g.: tenant not found) or some transient error (e.g.: networking issue) during the 5 mins of metadata refresh interval.