fix(worker): 记住轮询间隔内的容量需求

异步视频任务在 River 轮询空档会释放本地 lease,采样瞬间可能观察不到已经触顶的领取需求,导致自适应容量长期停在初始值。本提交记录采样窗口内出现过的容量饱和,同时保持空闲 Worker 不盲目升容。\n\n移植时保留主线现有的单节点容量阶梯、请求下限和严格失败门禁,仅合入失败路径先记录并排空任务与回调、再删除模拟器资源的清理顺序,并补充脚本守卫。\n\n验证:go test ./... -count=1;go vet ./...;bash -n;ShellCheck;production-acceptance-script-test.sh。
This commit is contained in:
2026-08-05 00:53:06 +08:00
parent ebdb96e7d7
commit 9ce9053d7b
4 changed files with 85 additions and 15 deletions
+6 -6
View File
@@ -381,12 +381,6 @@ cleanup() {
if [[ $remote_load_drivers_installed == true ]]; then
cleanup_remote_load_drivers >/dev/null 2>&1 || true
fi
if [[ $single_node_emulator_installed == true ]]; then
cleanup_single_node_emulator >/dev/null 2>&1 || true
fi
if [[ $single_node_acceptance == true ]]; then
cleanup_single_node_kubernetes_resources >/dev/null 2>&1 || true
fi
if (( status != 0 )) && [[ -n $run_id && $failure_recorded != true ]]; then
set +e
if [[ $single_node_acceptance == true ]]; then
@@ -398,6 +392,12 @@ cleanup() {
mark_run_failed "${failure_reason:-acceptance workflow exited unexpectedly}"
set -e
fi
if [[ $single_node_emulator_installed == true ]]; then
cleanup_single_node_emulator >/dev/null 2>&1 || true
fi
if [[ $single_node_acceptance == true ]]; then
cleanup_single_node_kubernetes_resources >/dev/null 2>&1 || true
fi
rm -rf -- "$temporary_root"
exit "$status"
}