You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is still an infinite loop opportunity in CompiledQueryCache.cs, RE: #7230
If the _querySyncObjects ConcurrentDictionary continuously fails to add for whatever reason, This method will never return. Some type of guard, max attempt counter, or even a timeout comparing times needs to be implemented.
@meikeric Are you hitting an infinite loop, or are you just saying that it is theoretically possible? If the former, could you provide a code listing or project that demonstrates the issue? If the latter, then it seems to us that this is, from a practical perspective, impossible unless there is a bug elsewhere. This is not to say we wouldn't accept a PR for this--we would consider it--but the downside is it makes the code more complex and harder to read, and it's not clear that the upside has enough value.
@ajcvickers It is theoretically.
So we can presume the implementation is safe at this time and working. For validation, I wrote a sample to stress test this, e.g. 4 threads on the NonCachingMemoryCache from the Tests just a fake CompileQueryCore with 100,000,000 loop iteration and I was NOT able to get this to infinite loop.
I would agree that there would have to be a bug upstream, either in the IMemoryCache implementation or something to cause a failure on the _querySyncObjects ConcurrentDictionary so the object can't be removed.
There is still an infinite loop opportunity in CompiledQueryCache.cs, RE: #7230
If the _querySyncObjects ConcurrentDictionary continuously fails to add for whatever reason, This method will never return. Some type of guard, max attempt counter, or even a timeout comparing times needs to be implemented.
Issue Core (Note the Goto-Retry Loop)
Proposed Fix:
The text was updated successfully, but these errors were encountered: