-
Notifications
You must be signed in to change notification settings - Fork 2.1k
KeyNotFoundException in Microsoft.Extensions.DiagnosticAdapter.Internal.ProxyTypeEmitter.GetProxyType #6292
Comments
Thrown from this method. |
@rynowak - any idea? |
The line that's throwing is probably here: https://github.com/aspnet/EventNotification/blob/master/src/Microsoft.Extensions.DiagnosticAdapter/Internal/ProxyTypeEmitter.cs#L75 Hypothesis:
I think what's happened is in between steps 2-3 another operation completed and updated the cache with the same type that we're looking for. Then at Line 104 we check for this and early exit. *But we didn't add the result to |
Thanks, it certainly looked like some kind of race condition. |
@rynowak I added a test for the scenario where the However, I am not sure how to repro the original issue/exception. |
The original bug is a threading issue, it would be very hard to reproduce consistently. We don't generally try to write unit tests for race conditions, it requires a level of effort and sophistication that we don't usually put into unit tests. |
Addresses possible race condition in aspnet/Mvc#6292
I see this fix has been marked for the 2.0.0 milestone. Will this not be fixed in 1.x.x? |
@davenewza the fix we did so far is for the upcoming 2.0 RTM release. @rynowak opened a new issue aspnet/EventNotification#76 to track fixing this in the next 1.x patch release. |
Oh oops, sorry I opened a tracking bug for that and forgot to comment here. |
Ah, great - thanks. |
Addresses possible race condition in aspnet/Mvc#6292 (cherry picked from commit f035508)
The following
KeyNotFoundException
exception has been throwing during requests to our API. I cannot reproduce it and there seems to be no consistency as to when it happens.The project is targeting the full .NET 4.6 framework and the following NuGet packages:
Does anyone know what this could be caused by?
The text was updated successfully, but these errors were encountered: