- 
                Notifications
    You must be signed in to change notification settings 
- Fork 834
Caches: remove EntityPool, improve metrics, add eviction stress test #18786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 
 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @majocha for finding the mistake which caused tests randomly to fail!
The race was within the pool usage?
| 
 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: