修复 BgFilter 发布窗口配置漂移

发布窗口内 callBudget 漂移改为告警计数并按 Worker 当前预算执行

Provision 验活地址改为从已校验的自定义端口派生

同步 BgFilter 调度方案与后端数据契约文档
This commit is contained in:
2026-07-22 12:10:40 +00:00
parent c03da0de0c
commit 070f8f8fa4
4 changed files with 65 additions and 42 deletions
+10 -4
View File
@@ -768,6 +768,9 @@ validate_bgfilter_loopback_endpoint_alignment() {
echo "[server-provision] 父进程 GENARRATIVE_BGFILTER_WORKER_BASE_URL 必须与 BgFilter worker 有效监听地址一致: expected=${expected_base_url}, actual=${base_url:-<empty>}" >&2
exit 1
fi
# 验活 URL 从这里已验证的 host/port 派生:校验允许 8083 以外的合法自定义端口,
# 后续 readiness 必须访问同一 endpoint,不能硬编码默认端口造成假阴性。
BGFILTER_WORKER_READYZ_URL="${expected_base_url}/readyz"
}
ensure_worker_runtime_env_defaults() {
@@ -1259,19 +1262,22 @@ render_bgfilter_worker_service() {
}
wait_for_bgfilter_worker_service() {
# 真实路径的 URL 由 validate_bgfilter_loopback_endpoint_alignment 从已验证 env 派生;
# dry-run 分支该校验提前返回,此处仅回显默认值。
local readyz_url="${BGFILTER_WORKER_READYZ_URL:-http://127.0.0.1:8083/readyz}"
if [[ "${DRY_RUN}" == "true" ]]; then
echo "+ curl -fsS --max-time 2 http://127.0.0.1:8083/readyz"
echo "+ curl -fsS --max-time 2 ${readyz_url}"
return
fi
echo "[server-provision] 等待 BgFilter worker readiness"
echo "[server-provision] 等待 BgFilter worker readiness: ${readyz_url}"
for _ in {1..30}; do
if systemctl is-active --quiet genarrative-bgfilter-worker.service && curl -fsS --max-time 2 http://127.0.0.1:8083/readyz >/dev/null; then
if systemctl is-active --quiet genarrative-bgfilter-worker.service && curl -fsS --max-time 2 "${readyz_url}" >/dev/null; then
return
fi
sleep 2
done
systemctl --no-pager --full status genarrative-bgfilter-worker.service || true
echo "[server-provision] BgFilter worker 未在超时时间内通过 readiness" >&2
echo "[server-provision] BgFilter worker 未在超时时间内通过 readiness: ${readyz_url}" >&2
exit 1
}