-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Make unwrapCorrupt Check Suppressed Ex. #41889
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
* 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
Jenkins run elasticsearch-ci/1 |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to check suppressed exceptions of Throwable.getCause
etc?
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.
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 :) |
@@ -175,10 +175,26 @@ public static String formatStackTrace(final StackTraceElement[] stackTrace) { | |||
return first; | |||
} | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add javadocs to mention that this checks both causes and suppressed exceptions?
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.
and maybe javadocs to unwrap
too to make it clear it doesn't look at suppressed exceptions?
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.
Sounds good, added javadoc to both :)
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.
LGTM
* 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
* 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
* Make unwrapCorrupt Check Suppressed Ex. (elastic#41889) * 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
* Make unwrapCorrupt Check Suppressed Ex. (elastic#41889) * 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