Fix possible race condition in ProjectRootElementCache.Get#7135
Conversation
Forgind
left a comment
There was a problem hiding this comment.
I imagine this would hurt perf? Do you have numbers on by how much?
542ac14 to
6634a66
Compare
|
Would you mind pasting a stack that shows the double call into the PR description? I remember this looked good when we talked about it but I've forgotten the details and they'd be good to have here for posterity. |
|
No, it should not affect perf at all. Posted a stack trace of the error in the description. The problem here is that we had double entry into Get() function of a cache, which is completely unnecessary and under some conditions it may lead to modifying |
|
The stack trace does not show the double call, cause the error happens in the time when we are already in the first call and just came out of the second call. (presumably) |
It was OK, but recently we have made changes that |
e550dd1 to
b43968f
Compare
Fixes possible race condition in
ProjectRootElementCache.Getsupposedly introduced in #6680.Context
Passing a load function that uses
ProjectRootElementCache.GettoProjectRootElementCache.Getfunction could lead to failure (to verify a path in the loaded ProjectRootElement), due to a race condition. We eliminate callingProjectRootElementCache.Getinside the load function, eliminating an unnecessary double entry toProjectRootElementCache.Getfunction.Changes Made
ProjectRootElementCache.Getfunction that could cause race condition.ProjectRootElementCacheandSimpleProjectRootElementCacheto be more safe and to have more information.Testing
Unit tests + manual testing
Notes
The stack trace of failure: