fix(scanner): respect lazy hash for checkpoints, add posix_fadvise, cancel on shutdown (#985)

This commit is contained in:
Will Miao
2026-06-16 23:00:23 +08:00
parent 2939813e1a
commit 58c266ad07
3 changed files with 22 additions and 3 deletions

View File

@@ -436,5 +436,14 @@ class LoraManager:
try:
logger.info("LoRA Manager: Cleaning up services")
# Cancel any in-flight scanner initialization tasks so thread-pool
# workers (e.g. _initialize_cache_sync) can break out of their loops
# when the server shuts down (e.g. Ctrl+C on WSL).
for name in ("lora_scanner", "checkpoint_scanner", "embedding_scanner"):
scanner = ServiceRegistry.get_service_sync(name)
if scanner is not None and hasattr(scanner, "cancel_task"):
scanner.cancel_task()
logger.debug("LoRA Manager: Cancelled %s", name)
except Exception as e:
logger.error(f"Error during cleanup: {e}", exc_info=True)