-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Transient failure to refresh a key ring produces a 500 response #33116
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
Comments
Thanks for contacting us. |
Tracked as part of #33116 |
Thanks for contacting us. |
This is definitely worth fixing and we're planning to prioritize it in 9.0, but I don't think this particular issue adds new details to the general understanding of the key creation/synchronization race. Tracked in #36157 and elsewhere. |
Here's how it happens:
KeyRingBasedDataProtector.UnprotectCore()
UnprotectCore
callsKeyRingProvider.GetCurrentKeyRingCore
to get keys. The latter determines that it needs to refresh the key ring from the repository.KeyRingProvider
does have the key ring available, so it extends its lifetime for 2 minutes and reports that from hereaspnetcore/src/DataProtection/DataProtection/src/KeyManagement/KeyRingProvider.cs
Line 211 in 3341e46
KeyRingProvider
re-throws the exception. Rationale for that is described hereaspnetcore/src/DataProtection/DataProtection/src/KeyManagement/KeyRingProvider.cs
Lines 229 to 231 in 3341e46
KeyRingBasedDataProtector.UnprotectCore
does not retry. If it did, it would get the key ring, because it's lifetime was just extended. But it just doesn't make that second call toGetCurrentKeyRing
aspnetcore/src/DataProtection/DataProtection/src/KeyManagement/KeyRingBasedDataProtector.cs
Line 239 in 3341e46
Here's a stack trace for your reference
The text was updated successfully, but these errors were encountered: