[feat][PES][jobhistory] add task-diagnosis api to classify failed tasks into linkis or underlying cause - #1095
Merged
Merged
Conversation
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.
What is the purpose of the change
Background/Problem:
When a Linkis task fails, the jobhistory record only stores the raw error code, error desc and metrics. It does not indicate whether the failure originated from the Linkis framework (scheduling, entrance, engineconn) or from the underlying compute engine/resource (YARN container killed, OOM, file/permission errors). Ops engineers must manually inspect logs to root-cause each failure, which is slow and hurts troubleshooting efficiency.
Purpose of Change:
To address this problem, this PR adds a task-diagnosis RESTful API in the jobhistory service that automatically classifies a failed task into a diagnosis type (LINKIS / UNDERLYING / UNKNOWN) and the failed stage (Scheduling / Execution), driven by configurable error-code ranges and keyword rules parsed from the task's error code, error desc and metrics.
Value/Impact:
After the change, ops and upper applications can call a single API to get a structured diagnosis result, distinguishing framework issues from engine/resource issues. This speeds up ticket routing and enables AI-driven ops diagnosis, while the feature is off by default and degrades gracefully on exception.
Related issues/PRs
Related issues: close #1094
Related pr:none
Brief change log
TaskDiagnosisServiceinterface andTaskDiagnosisServiceImplto classify failed tasks by diagnosis type and failed stageDiagnosisResultentity carrying diagnosisType, failedStage, errorCode, errorDesc and engine/yarn contextTaskDiagnosisConfigurationwith a hot-reloadable enable switch and configurable error-code/keyword rule setsGET /jobhistory/task-diagnosisendpoint inQueryRestfulApiwith permission check and exception-safe fallbackChecklist