[Feat] hicache: Notify storage backends when the initial host-pool registration burst completes (#44030)

Co-authored-by: Zhangheng <hzh0425@apache.org>
This commit is contained in:
lpdink
2026-10-20 14:09:13 +08:00
committed by GitHub
co-authored by Zhangheng
parent 36978d6c4d
commit 4a651146de
7 changed files with 257 additions and 0 deletions
@@ -530,6 +530,10 @@ class HiCacheController:
)
raise RuntimeError("Failed to stop HiCache storage threads cleanly.")
# A subclass whose attach continues registering host pools after super()
# returns fires on_host_pools_registered() itself, once.
_registers_host_pools_after_super_attach = False
def attach_storage_backend(
self,
storage_backend: str,
@@ -578,6 +582,8 @@ class HiCacheController:
storage_backend, self.storage_config, self.storage_host_pool
)
self.storage_backend.register_mem_pool_host(self.storage_host_pool)
if not self._registers_host_pools_after_super_attach:
self.storage_backend.on_host_pools_registered()
self.enable_storage = True
# todo: threshold policy for prefetching