stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.79k stars 188 forks source link

fix(embedded resources): Use concurrent dictionnary for resource cache #3095

Closed dupdob closed 2 weeks ago

dupdob commented 2 weeks ago

Fix #3071 Fix #3088 Fix #3090 It is a naive fix (using a concurrent dictionnary instead of normal one). As far as I understand the code, the remaining risk is loading twice some resource in case of concurrent access. I do not think this will be an issue.

A proper fix is to ensure access to the cache is exclusive (at least for the writing part), which require more code and testing (especially) that I feel this issue warrants. But I could be convinced to provide a better implementation 😉.

rouke-broersma commented 2 weeks ago

Strange that this just started happening. For now I think this is fine, if you have time to implement a future proof and tested fix that would of course be welcome :)

We should probably not mix in embedded resources from different projects into the same collection..

dupdob commented 2 weeks ago

The change regarding the use of a global cache is recent; it looks also like this happens with large solutions, which increases the concurrency. It may be a matter of running on platform with more cores....

sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud