Skip to content

Surface per-task status summary in Helix JobContext#214

Open
LZD-PratyushBhatt wants to merge 1 commit into
devfrom
lzd/job-task-status-summary
Open

Surface per-task status summary in Helix JobContext#214
LZD-PratyushBhatt wants to merge 1 commit into
devfrom
lzd/job-task-status-summary

Conversation

@LZD-PratyushBhatt

@LZD-PratyushBhatt LZD-PratyushBhatt commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

When a Task Framework job is configured with a high FailureThreshold so that every partition task is allowed to run to completion, the job's own status flag stays COMPLETED even if individual tasks fail. That masks partial failures: operators watching only the job state cannot tell that some partitions errored, aborted, or timed out.

This adds an aggregated, job-level task status summary that the controller computes and writes into the JobContext when a job reaches a terminal state (completed, failed, or timed out). The summary carries completed/failed counts, a per-state breakdown, and the list of failed partitions, so partial failures stay visible even when the job flag is COMPLETED. Reading the summary is a clean alternative to the Integer.MAX_VALUE FailureThreshold workaround.

helix-core:

  • JobContext#updateTaskStatusSummary computes the summary from per-partition states and stores it as the TASK_STATUS_SUMMARY simple field (JSON); JobContext#getTaskStatusSummary reads it back.
  • AbstractTaskDispatcher invokes it at the three terminal choke points (markJobComplete, failJob, handleJobTimeout).

helix-front:

  • Job detail view gains a "Task Summary" tab that parses TASK_STATUS_SUMMARY and highlights failures.

Tests:

  • TestJobTaskStatusSummary integration test (job COMPLETED, summary reports the failures).
  • JobTaskSummaryDriver standalone end-to-end driver (runs against a live ZK).
  • job-detail component specs for the new getters.

Locally tested in real helix cluster:
image

Issues

  • My PR addresses the following Helix issues and references them in the PR description:

(#200 - Link your issue number here: You can write "Fixes #XXX". Please use the proper keyword so that the issue gets closed automatically. See https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue
Any of the following keywords can be used: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved)

Description

  • Here are some details about my PR, including screenshots of any UI changes:

(Write a concise description including what, why, how)

Tests

  • The following tests are written for this issue:

(List the names of added unit/integration tests)

  • The following is the result of the "mvn test" command on the appropriate module:

(If CI test fails due to known issue, please specify the issue and test PR locally. Then copy & paste the result of "mvn test" to here.)

Changes that Break Backward Compatibility (Optional)

  • My PR contains changes that break backward compatibility or previous assumptions for certain methods or API. They include:

(Consider including all behavior changes for public methods or API. Also include these changes in merge description so that other developers are aware of these changes. This allows them to make relevant code changes in feature branches accounting for the new method/API behavior.)

Documentation (Optional)

  • In case of new functionality, my PR adds documentation in the following wiki page:

(Link the GitHub wiki you added)

Commits

  • My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Code Quality

  • My diff has been formatted using helix-style.xml
    (helix-style-intellij.xml if IntelliJ IDE is used)

When a Task Framework job is configured with a high FailureThreshold so that
every partition task is allowed to run to completion, the job's own status flag
stays COMPLETED even if individual tasks fail. That masks partial failures:
operators watching only the job state cannot tell that some partitions errored,
aborted, or timed out.

This adds an aggregated, job-level task status summary that the controller
computes and writes into the JobContext when a job reaches a terminal state
(completed, failed, or timed out). The summary carries completed/failed counts,
a per-state breakdown, and the list of failed partitions, so partial failures
stay visible even when the job flag is COMPLETED. Reading the summary is a clean
alternative to the Integer.MAX_VALUE FailureThreshold workaround.

helix-core:
- JobContext#updateTaskStatusSummary computes the summary from per-partition
  states and stores it as the TASK_STATUS_SUMMARY simple field (JSON);
  JobContext#getTaskStatusSummary reads it back.
- AbstractTaskDispatcher invokes it at the three terminal choke points
  (markJobComplete, failJob, handleJobTimeout).

helix-front:
- Job detail view gains a "Task Summary" tab that parses TASK_STATUS_SUMMARY
  and highlights failures.

Tests:
- TestJobTaskStatusSummary integration test (job COMPLETED, summary reports the
  failures).
- JobTaskSummaryDriver standalone end-to-end driver (runs against a live ZK).
- job-detail component specs for the new getters.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@LZD-PratyushBhatt
LZD-PratyushBhatt force-pushed the lzd/job-task-status-summary branch from 7edef10 to 5d3303d Compare July 21, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant