Skip to content

[BugFix] reset exist tasks signal in clear_data#7111

Merged
Jiang-Jia-Jun merged 4 commits intoPaddlePaddle:developfrom
liyonghua0910:develop+20260331_fix_clear_data
Mar 31, 2026
Merged

[BugFix] reset exist tasks signal in clear_data#7111
Jiang-Jia-Jun merged 4 commits intoPaddlePaddle:developfrom
liyonghua0910:develop+20260331_fix_clear_data

Conversation

@liyonghua0910
Copy link
Copy Markdown
Collaborator

Motivation

EngineWorkerQueue.clear_data() cleared queued tasks and reset client_read_flag, but it did not reset the exist_task signal.

This could leave the queue in an inconsistent state where exist_tasks() still returned true after the task payload had already been cleared. In that case, workers could still enter the get_tasks() path and observe
an empty task list, which may trigger downstream assertion failures.

This PR fixes the queue state inconsistency by resetting the exist_task signal together with queue cleanup.

Modifications

  • Update EngineWorkerQueue.clear_data() to reset the exist_task signal when clearing the queue
  • Keep queue payload state and task-existence state consistent during cleanup
  • Prevent workers from observing stale queue-available state after forced clear operations

Usage or Command

This PR is a bug fix. No new usage is introduced.

Accuracy Tests

This change does not modify model forward logic, kernel behavior, or output generation semantics.

Accuracy impact: none expected.

Checklist

  • Add at least a tag in the PR title.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.

@paddle-bot
Copy link
Copy Markdown

paddle-bot bot commented Mar 31, 2026

Thanks for your contribution!

Copy link
Copy Markdown

@fastdeploy-bot fastdeploy-bot left a comment

Choose a reason for hiding this comment

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

🤖 AI Code Review | 2026-03-31 19:47 CST

📋 Review 摘要

PR 概述:修复 EngineWorkerQueue.clear_data() 未重置 exist_task 信号导致的队列状态不一致问题
变更范围:inter_communicator/engine_worker_queue.py, worker/worker_process.py
影响面 Tag[Engine] [BugFix]

问题

未发现阻塞性问题。

总体评价

本 PR 修复了队列状态不一致的 bug,代码实现正确,与现有的 set_exist_tasks() 方法逻辑一致。continue 缩进调整和日志级别降级也是合理的优化。建议补充单元测试以覆盖此场景。

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@dd2aa10). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...stdeploy/inter_communicator/engine_worker_queue.py 33.33% 1 Missing and 1 partial ⚠️
fastdeploy/worker/worker_process.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #7111   +/-   ##
==========================================
  Coverage           ?   73.98%           
==========================================
  Files              ?      402           
  Lines              ?    56576           
  Branches           ?     8942           
==========================================
  Hits               ?    41856           
  Misses             ?    11780           
  Partials           ?     2940           
Flag Coverage Δ
GPU 73.98% <40.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Jiang-Jia-Jun Jiang-Jia-Jun merged commit a3cc3aa into PaddlePaddle:develop Mar 31, 2026
36 of 38 checks passed
@EmmonsCurse
Copy link
Copy Markdown
Collaborator

❌ Cherry-pick failed: Conflicts detected when cherry-picking to release/2.4. Please resolve manually.

@EmmonsCurse
Copy link
Copy Markdown
Collaborator

❌ Cherry-pick failed: Conflicts detected when cherry-picking to release/2.5. Please resolve manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants