[Bugfix][KV Connector] Propagate cache reset failure during sleep (#54581)

Signed-off-by: CrazyCoder <18235787078@163.com>
Signed-off-by: aoshen02 <aoshen@inferact.ai>
Co-authored-by: aoshen02 <aoshen@inferact.ai>
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
CrazyCoder
2026-09-21 09:25:02 +08:00
committed by GitHub
co-authored by aoshen02 Codex
parent 7ddd461a28
commit 1185254851
+9 -4
View File
@@ -867,10 +867,11 @@ class EngineCore:
# reset_connector=True so external connectors clear alongside
# local caches, matching the pause_generation(clear_cache=True)
# contract. No-op when no connector is configured.
self.reset_prefix_cache(
if not self.reset_prefix_cache(
reset_running_requests=reset_running_requests,
reset_connector=reset_connector,
)
):
raise RuntimeError("Failed to reset the KV connector cache.")
self.reset_mm_cache()
self.reset_encoder_cache()
@@ -2001,8 +2002,12 @@ class EngineCoreProc(EngineCore):
raise ValueError(f"Invalid pause mode: {mode}")
def engine_idle_callback(engine: "EngineCoreProc", future: Future[Any]) -> None:
engine._finish_pause(clear_cache)
future.set_result(None)
try:
engine._finish_pause(clear_cache)
except Exception as e:
future.set_exception(e)
else:
future.set_result(None)
if mode == "abort":
aborted_reqs = self.scheduler.finish_requests(