Caches: remove EntityPool, improve metrics, add eviction stress test#18786
Caches: remove EntityPool, improve metrics, add eviction stress test#18786T-Gro merged 8 commits intodotnet:mainfrom
Conversation
❗ Release notes requiredCaution No release notes found for the changed paths (see table below). Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format. The following format is recommended for this repository:
If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request. You can open this PR in browser to add release notes: open in github.dev
|
Yes, see #18819 (comment) I tried disabling the pool and it fixed things. Then went through the file with copilot, some diagnosis was misguided but it did catch it and explain what's going on. |

Edit:
First of all, this fixes #18819 by removing
EntityPoolfrom Cache.The problem manifested itself when executing
EmittedIL.Structuretests in parallel.It was reproducible locally. I checked locally that it's fixed by running many iterations ("run until failure" in VS) without fail.
Some additional checks and tests around eviction added around a singular possible eviction fail I noticed in the CI:
This could mean that the test that waits for eviction event never gets that event in some rare circumstances.
So, this adds another diagnostic event
EvictionFail. If it ever happens (again?), it should show up in CI.A basic stress test is added. I also cleaned up
CacheMetricscode a bit.Another thing: depending on the dotnet test's
--blame-hang-timeoutinstead of using explicit timeouts in the tests. This sounds good in theory. In practice, if the testhost timeouts while executing tests in parallel, the only info we get is a bunch of tests that were executing at the moment. A pragmatic solution would probably be: