Maybe die before failing engine#28973
Merged
jasontedor merged 4 commits intoelastic:masterfrom Mar 10, 2018
Merged
Conversation
Today we check for a few cases where we should maybe die before failing the engine (e.g., when a merge fails). However, there are still other cases where a fatal error can be hidden from us (for example, a failed index writer commit). This commit modifies the mechanism for failing the engine to always check for a fatal error before failing the engine.
Member
Author
|
Note there is an existing test for this in |
dakrone
approved these changes
Mar 9, 2018
Member
dakrone
left a comment
There was a problem hiding this comment.
LGTM, I left one comment you may change or not change, up to you.
| */ | ||
| @SuppressWarnings("finally") | ||
| private void maybeDie(final String maybeMessage, final Throwable maybeFatal) { | ||
| final Optional<Error> maybeError = ExceptionsHelper.maybeError(maybeFatal, logger); |
Member
There was a problem hiding this comment.
As long as you're using Optional here, I think this could be
ExceptionsHelper.maybeError(maybeFatal, logger).ifPresent(e -> {
try {
logger.error(maybeMessage, e);
} finally {
throw e;
}});Up to you if you want though
richardun
reviewed
Mar 10, 2018
| /** | ||
| * If the specified throwable contains a fatal error in the throwable graph, such a fatal error will be thrown. Callers should ensure | ||
| * that there are no catch statements that would catch an error in the stack as the fatal error here should go uncaught and be handled | ||
| * by the uncaught exception handler that we install during bootstrap. If the specified throwable dies indeed contain a fatal error, the |
There was a problem hiding this comment.
Extremely insignificant, but just for clarity: I think you mean "does" (indeed contain a fatal error) on this line.
Member
Author
There was a problem hiding this comment.
Thank you @richardun, I appreciate the attention to detail. I will push a correction in the morning.
jasontedor
added a commit
that referenced
this pull request
Mar 10, 2018
Today we check for a few cases where we should maybe die before failing the engine (e.g., when a merge fails). However, there are still other cases where a fatal error can be hidden from us (for example, a failed index writer commit). This commit modifies the mechanism for failing the engine to always check for a fatal error before failing the engine.
jasontedor
added a commit
that referenced
this pull request
Mar 10, 2018
Today we check for a few cases where we should maybe die before failing the engine (e.g., when a merge fails). However, there are still other cases where a fatal error can be hidden from us (for example, a failed index writer commit). This commit modifies the mechanism for failing the engine to always check for a fatal error before failing the engine.
jasontedor
added a commit
that referenced
this pull request
Mar 10, 2018
Today we check for a few cases where we should maybe die before failing the engine (e.g., when a merge fails). However, there are still other cases where a fatal error can be hidden from us (for example, a failed index writer commit). This commit modifies the mechanism for failing the engine to always check for a fatal error before failing the engine.
jasontedor
added a commit
that referenced
this pull request
Mar 10, 2018
Today we check for a few cases where we should maybe die before failing the engine (e.g., when a merge fails). However, there are still other cases where a fatal error can be hidden from us (for example, a failed index writer commit). This commit modifies the mechanism for failing the engine to always check for a fatal error before failing the engine.
sebasjm
pushed a commit
to sebasjm/elasticsearch
that referenced
this pull request
Mar 10, 2018
Today we check for a few cases where we should maybe die before failing the engine (e.g., when a merge fails). However, there are still other cases where a fatal error can be hidden from us (for example, a failed index writer commit). This commit modifies the mechanism for failing the engine to always check for a fatal error before failing the engine.
jasontedor
added a commit
to jasontedor/elasticsearch
that referenced
this pull request
Mar 12, 2018
* master: (28 commits) Maybe die before failing engine (elastic#28973) Remove special handling for _all in nodes info Remove Booleans use from XContent and ToXContent (elastic#28768) Update Gradle Testing Docs (elastic#28970) Make primary-replica resync failures less lenient (elastic#28534) Remove temporary file 10_basic.yml~ Use different pipeline id in test. (pipelines do not get removed between tests extending from ESIntegTestCase) Use fixture to test the repository-gcs plugin (elastic#28788) Use String.join() to describe a list of tasks (elastic#28941) Fixed incorrect test try-catch statement Plugins: Consolidate plugin and module loading code (elastic#28815) percolator: Take `matchAllDocs` and `verified` of the sub result into account when analyzing a function_score query. Build: Remove rest tests on archive distribution projects (elastic#28952) Remove FastStringReader in favor of vanilla StringReader (elastic#28944) Remove FastCharArrayReader and FastCharArrayWriter (elastic#28951) Continue registering pipelines after one pipeline parse failure. (elastic#28752) Build: Fix ability to ignore when no tests are run (elastic#28930) [rest-api-spec] update doc link for /_rank_eval Switch XContentBuilder from BytesStreamOutput to ByteArrayOutputStream (elastic#28945) Factor UnknownNamedObjectException into its own class (elastic#28931) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Today we check for a few cases where we should maybe die before failing the engine (e.g., when a merge fails). However, there are still other cases where a fatal error can be hidden from us (for example, a failed index writer commit). This commit modifies the mechanism for failing the engine to always check for a fatal error before failing the engine.
Relates #27265, closes #28967