fix(chv): 生产级审核 P1-01~P1-10 修复(堆叠于 #270 之上)
This commit is contained in:
1 parent
8c8d62f70d
commit
971e054938
12 files changed
+1545
-120
No files matched your search
@@ -159,8 +159,14 @@ class WarmPool:
|
||||
|
||||
对每个条目尽力 shutdown_vm,条目清掉并落盘,返回
|
||||
已清理的 VM 名列表。生产启动/关闭不走本方法,走
|
||||
cloud.chv.orphans.reconcile_orphans_for_executor()。"""
|
||||
cloud.chv.orphans.reconcile_orphans_for_executor()。
|
||||
feat-chv-p1fix(P1-01 同款语义):shutdown 失败的
|
||||
条目不进 cleaned、不从内存条目里 pop(下次 reconcile
|
||||
可重试),并记 failed 审计;文件落盘仍只写
|
||||
warm/assigned 态(见 P2-16,实验路径的文件语义
|
||||
本轨不改,内存态保留即重试依据)。"""
|
||||
cleaned = []
|
||||
failed = []
|
||||
for name, entry in list(self._entries.items()):
|
||||
if entry["state"] not in ("orphan", "assigned"):
|
||||
continue
|
||||
@@ -168,7 +174,8 @@ class WarmPool:
|
||||
try:
|
||||
self.executor.shutdown_vm(vm)
|
||||
except Exception:
|
||||
pass
|
||||
failed.append(vm)
|
||||
continue
|
||||
self._entries.pop(name, None)
|
||||
cleaned.append(vm)
|
||||
if cleaned:
|
||||
@@ -179,6 +186,14 @@ class WarmPool:
|
||||
"cleaned=%s" % ",".join(cleaned))
|
||||
except Exception:
|
||||
pass
|
||||
if failed:
|
||||
try:
|
||||
self.executor._emit(
|
||||
"warm_pool_reconcile_failed", {"id": None},
|
||||
"failed=%s cleaned=%s" % (
|
||||
",".join(failed), ",".join(cleaned)))
|
||||
except Exception:
|
||||
pass
|
||||
return cleaned
|
||||
|
||||
# -- 池操作 ----------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user