Skip to content

check for task completion by using task progress#2290

Merged
s3inlc merged 4 commits into
masterfrom
2270-bug-tasks-show-wrong-status
Jul 2, 2026
Merged

check for task completion by using task progress#2290
s3inlc merged 4 commits into
masterfrom
2270-bug-tasks-show-wrong-status

Conversation

@jessevz

@jessevz jessevz commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

closes #2270

…king task progress and not keyspaceprogress
@jessevz jessevz requested review from Copilot and s3inlc July 1, 2026 06:10
@jessevz jessevz linked an issue Jul 1, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses #2270 by making task “completion”/status reflect searched progress rather than distributed keyspace progress, so tasks don’t appear completed (green) immediately after distribution reaches 100%.

Changes:

  • Update aggregate status computation to pass task progress (searched) into TaskUtils::getStatus() instead of keyspaceProgress (distributed).
  • Simplify TaskUtils::getStatus() “running” detection by relying on recent chunk activity (dispatch/solve time).
  • Apply the updated status calculation in both task and task-wrapper v2 API models.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/inc/utils/TaskUtils.php Adjusts the “running” condition used when deriving a task status from chunk activity.
src/inc/apiv2/model/TaskWrapperDisplayAPI.php Uses searched progress (getTaskProgress) when calculating per-task status for wrapper aggregation.
src/inc/apiv2/model/TaskAPI.php Uses searched progress (getTaskProgress) when calculating aggregate task status.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/inc/apiv2/model/TaskWrapperDisplayAPI.php Outdated
Comment thread src/inc/apiv2/model/TaskAPI.php Outdated
Comment thread src/inc/utils/TaskUtils.php

@s3inlc s3inlc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with copilot on its comment about removing the check for progress < 10000, currently indeed the function only is called by filtering before, but the function may be used at some other place later.

What probably would be the best way is to integrate the query to get the chunks itself into the function getStatus(), so that you only pass the Task object as argument and everything else is done inside the function. This avoids that mistake calls can be made to the function (with not the right chunks filtered out) and also reduces code duplication.

@s3inlc s3inlc added this to the Release v1.0.0 milestone Jul 1, 2026
@jessevz jessevz requested a review from s3inlc July 1, 2026 21:03
@s3inlc s3inlc merged commit 8478e94 into master Jul 2, 2026
14 checks passed
@s3inlc s3inlc deleted the 2270-bug-tasks-show-wrong-status branch July 2, 2026 06:54
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.

[BUG]: Tasks show wrong status

3 participants