Make unwrapCorrupt Check Suppressed Ex.#41889
Make unwrapCorrupt Check Suppressed Ex.#41889original-brownbear merged 4 commits intoelastic:masterfrom original-brownbear:24800
Conversation
|
Pinging @elastic/es-distributed |
|
Jenkins run elasticsearch-ci/1 |
server/src/test/java/org/elasticsearch/indices/recovery/RecoverySourceHandlerTests.java
Outdated
Show resolved
Hide resolved
|
Jenkins run elasticsearch-ci/1 |
ywelsch
left a comment
There was a problem hiding this comment.
This should also have more tests
| IOException corruptionException = | ||
| (IOException) unwrap(t, CorruptIndexException.class, IndexFormatTooOldException.class, IndexFormatTooNewException.class); | ||
| if (corruptionException == null && t != null) { | ||
| for (Throwable suppressed : t.getSuppressed()) { |
There was a problem hiding this comment.
do we need to check suppressed exceptions of Throwable.getCause etc?
There was a problem hiding this comment.
Right! I guess we should will add that together with tests in a sec :)
|
@ywelsch done, added more tests and made it follow the suppressions on causes as well :) |
| private static final List<Class<? extends IOException>> CORRUPTION_EXCEPTIONS = | ||
| List.of(CorruptIndexException.class, IndexFormatTooOldException.class, IndexFormatTooNewException.class); | ||
|
|
||
| public static IOException unwrapCorruption(Throwable t) { |
There was a problem hiding this comment.
can you add javadocs to mention that this checks both causes and suppressed exceptions?
There was a problem hiding this comment.
and maybe javadocs to unwrap too to make it clear it doesn't look at suppressed exceptions?
There was a problem hiding this comment.
Sounds good, added javadoc to both :)
* master: (82 commits) Fix off-by-one error in an index shard test Cleanup Redundant BlobStoreFormat Class (elastic#42195) remove backcompat handling of 6.2.x versions (elastic#42044) Mute testDelayedOperationsBeforeAndAfterRelocated Execute actions under permit in primary mode only (elastic#42241) Mute another transforms_stats yaml test Deprecate support for chained multi-fields. (elastic#41926) Mute transforms_stats yaml test Make unwrapCorrupt Check Suppressed Ex. (elastic#41889) Remove Dead Code from Azure Repo Plugin (elastic#42178) Reorganize Painless doc structure (elastic#42303) Avoid unnecessary persistence of retention leases (elastic#42299) [ML][TEST] Fix limits in AutodetectMemoryLimitIT (elastic#42279) [ML Data Frame] Persist and restore checkpoint and position (elastic#41942) mute failing filerealm hash caching tests (elastic#42304) Safer Wait for Snapshot Success in ClusterPrivilegeTests (elastic#40943) Remove 7.0.2 (elastic#42282) Revert "Remove 7.0.2 (elastic#42282)" [DOCS] Copied note on slicing support to Slicing section. Closes 26114 (elastic#40426) Remove 7.0.2 (elastic#42282) ...
* Make unwrapCorrupt Check Suppressed Ex. * As discussed in elastic#24800 we want to check for suppressed corruption indicating exceptions here as well to more reliably categorize corruption related exceptions * Closes elastic#24800, 41201
indicating exceptions here as well to more reliably categorize
corruption related exceptions