Fix flaky testOverflowDisabledAsynchronous by throwing AlreadyClosedException#20848
Conversation
…xception When the file cache is full and a blob fetch races with cache eviction, DelayedCreationCachedIndexInput.getIndexInput() throws an IllegalStateException, so this surfaces as an IllegalStateException instead of the IOException callers expect. Replace IllegalStateException with Lucene's AlreadyClosedException (which extends IOException) in both getIndexInput() and asyncLoadIndexInput(). Signed-off-by: Andrew Ross <andrross@amazon.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
❌ Gradle check result for 3586e08: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
The reference counting is unchanged here. The fix is to throw the correct exception. The race is that there is a very short period of time where a closed index input is still in the cache. If the test observed this case it would see an IllegalStateException. The other path where there is no existing entry in the cache throws an IOException as expected. The change is to make the exception consistent in both cases. |
|
❕ Gradle check result for 3586e08: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #20848 +/- ##
============================================
+ Coverage 73.30% 73.35% +0.04%
- Complexity 72252 72296 +44
============================================
Files 5795 5795
Lines 330056 330056
Branches 47643 47643
============================================
+ Hits 241947 242098 +151
+ Misses 68695 68515 -180
- Partials 19414 19443 +29 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
When the file cache is full and a blob fetch races with cache eviction, DelayedCreationCachedIndexInput.getIndexInput() throws an IllegalStateException, so this surfaces as an IllegalStateException instead of the IOException callers expect. Replace IllegalStateException with Lucene's AlreadyClosedException (which extends IOException) in both getIndexInput() and asyncLoadIndexInput().
Resolves #18850
Resolves #16676
Resolves #18872
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.