Include exception message in errorMessage for failed task#16286
Merged
kfaraz merged 5 commits intoapache:masterfrom Apr 18, 2024
Merged
Include exception message in errorMessage for failed task#16286kfaraz merged 5 commits intoapache:masterfrom
kfaraz merged 5 commits intoapache:masterfrom
Conversation
kfaraz
reviewed
Apr 15, 2024
…ord/TaskQueue.java Co-authored-by: Kashif Faraz <kashif.faraz@gmail.com>
Contributor
|
@YongGang , |
kfaraz
reviewed
Apr 16, 2024
| + "See overlord logs for more details."; | ||
| errorMessage = StringUtils.format( | ||
| "Encountered error[%s] while waiting for task to be ready. See Overlord logs for more details.", | ||
| e.getMessage() |
Contributor
There was a problem hiding this comment.
It would also be a good idea to trim this message if it exceeds a certain length.
Contributor
Author
There was a problem hiding this comment.
Thanks Kashif, updated the code.
Contributor
There was a problem hiding this comment.
We should be chopping only the contents of e.getMessage(). Chopping out the parts while waiting for task to be ready. See Overlord logs for more details. would be less user friendly.
Contributor
There was a problem hiding this comment.
Suggested change
| e.getMessage() | |
| StringUtils.chop(e.getMessage(), 100) |
kfaraz
approved these changes
Apr 18, 2024
| Assert.assertNotNull(statusOptional.get().getErrorMsg()); | ||
| Assert.assertTrue( | ||
| statusOptional.get().getErrorMsg().startsWith("Failed while waiting for the task to be ready to run") | ||
| statusOptional.get().getErrorMsg().contains(exceptionMsg) |
Contributor
There was a problem hiding this comment.
Nit: Better to verify the whole error message rather than contains.
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.
Description
Following is an example of auto-compaction subtask failure we can see from task Status field in Druid console.
Now include the actual exception message in the task Status output to easily understand the failure instead of having to check from Overlord logs.
Key changed/added classes in this PR
TaskQueue.javaadd exception message to errorMessageThis PR has: