Skip to content

<fix>[longjob]: clean stale progress on rerun#3311

Closed
zstack-robot-1 wants to merge 1 commit into5.5.6from
sync/ye.zou/ZSTAC-82077
Closed

<fix>[longjob]: clean stale progress on rerun#3311
zstack-robot-1 wants to merge 1 commit into5.5.6from
sync/ye.zou/ZSTAC-82077

Conversation

@zstack-robot-1
Copy link
Collaborator

When a failed LongJob is rerun, the old apiId's TaskProgressVO
records (containing 100%) were not cleaned up. The new execution
would inherit stale progress data, causing the UI to show 100%
immediately. Add deleteTaskProgress() for immediate hard-delete
and call it before updating apiId in the rerun path.

Resolves: ZSTAC-82077

Change-Id: I88a9d8089218a475fdfbe21e451f0947 -
Signed-off-by: AlanJager ye.zou@zstack.io

sync from gitlab !9132

When a failed LongJob is rerun, the old apiId's TaskProgressVO
records (containing 100%) were not cleaned up. The new execution
would inherit stale progress data, causing the UI to show 100%
immediately. Add deleteTaskProgress() for immediate hard-delete
and call it before updating apiId in the rerun path.

Resolves: ZSTAC-82077

Change-Id: I88a9d8089218a475fdfbe21e451f0947  -
Signed-off-by: AlanJager <ye.zou@zstack.io>
@coderabbitai
Copy link

coderabbitai bot commented Feb 7, 2026

Walkthrough

添加了新的deleteTaskProgress方法用于删除任务进度记录,并在长任务重新提交时调用该方法删除旧API ID的进度数据,防止显示过期的完成状态。

Changes

Cohort / File(s) Summary
新增进度删除接口
core/src/main/java/org/zstack/core/progress/ProgressReportService.java
新增public方法deleteTaskProgress(String apiId),用于根据apiId执行硬删除TaskProgressVO记录,包含空值检查逻辑。
长任务重新提交流程
longjob/src/main/java/org/zstack/longjob/LongJobManagerImpl.java
在SubmitLongJobMsg处理时,重新提交现有LongJob前,调用deleteTaskProgress方法删除旧API ID对应的任务进度,随后更新API ID。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 旧进度随风去,新任务焕新颜,
删除陈旧的百分百,让重跑不再尴尬,
长任务管理更清爽,兔兔为此欢呼吧!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required format '[scope]: ' with 45 characters, well under the 72-character limit, and accurately describes the main change: cleaning stale progress data on LongJob reruns.
Description check ✅ Passed The description is directly related to the changeset, clearly explaining the problem (stale progress data on rerun), the solution (adding deleteTaskProgress method), and providing context including the resolved issue number.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sync/ye.zou/ZSTAC-82077

Comment @coderabbitai help to get the list of available commands and usage tips.

@zstack-robot-2 zstack-robot-2 deleted the sync/ye.zou/ZSTAC-82077 branch February 8, 2026 05: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.

3 participants