修复 worker slot 初始化失败导致的批次死循环 - #715
Merged
Merged
Conversation
slot_can_schedule 把 suspended/dead 也算可调度,schedule() 又按 group 与 slot 编号取第一个,只剩单个 pending case 时它必然反复落到同一个 slot 上:启动失败 → INIT_TIMEOUT → suspend → 回队 → 再次选中,既没有退避也没有上限,其余已 ready 的 worker 全程闲置,批次永远不会结束。 - slot 记录连续初始化失败次数并按 5/15/30/60 s 退避,达到上限后进入 retired 不再复活 (PADDLEAPITEST_MAX_SLOT_INIT_FAILURES 可调,0 表示只退避不放弃) - 候选 slot 改为 idle 优先、其次按失败次数递增,健康 worker 先接活 - cancel_failed_startup 对退避/退役 slot 也回队,避免 assignment 与 reservation 永久滞留 - 所有 slot 失能而 case 未跑完时立即以失败退出:退避与重启交替会不断刷新初始化状态, PRESSURE_TIMEOUT 的连续阻塞窗口永远攒不满,无法作为兜底 - INIT_TIMEOUT 在 kill 之前落盘 wrapper 与 sanitizer 进程组的 py-spy 栈及 proc 状态, 偶发挂死此前没有任何可事后归因的现场(PADDLEAPITEST_INIT_TIMEOUT_DIAGNOSTICS 可关) 已知未解决:compute-sanitizer 会话偶发卡死在 ctypes.util.find_library 的 vfork, 1204 次并发 fork 压测未能复现,真因未定位;本次只保证它不再演化成死循环。
feixi139
force-pushed
the
fix-slot-init-livelock
branch
from
August 21, 2026 07:36
35e7de8 to
ff4410e
Compare
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.
修改内容
增加初始化失败退避和退役
优化调度和回队逻辑
增加快速失败
增加初始化超时诊断
<TEST_LOG_PATH>/init_timeout/。PADDLEAPITEST_INIT_TIMEOUT_DIAGNOSTICS=0关闭。