fix: HiRadixCache: fix prefetch completion race (#9397)

This commit is contained in:
Pablo Iyu Guerrero
2025-08-27 09:43:01 +02:00
committed by GitHub
parent 79e6a8a6ac
commit a3aee7c377

View File

@@ -434,9 +434,12 @@ class HiRadixCache(RadixCache):
if self.prefetch_stop_policy == "best_effort":
return can_terminate
completed = (
operation.completed_tokens == len(operation.hash_value) * self.page_size
)
if len(operation.hash_value) == 0:
completed = False
else:
completed = (
operation.completed_tokens == len(operation.hash_value) * self.page_size
)
if self.prefetch_stop_policy == "wait_complete":
can_terminate = completed