[HiCache] Yield idle scheduler so storage workers can drain (#38504)

This commit is contained in:
Shuwen Wang
2026-09-17 10:56:11 +08:00
committed by GitHub
parent 241a5b9823
commit 33d46376a6
2 changed files with 7 additions and 2 deletions
+5 -1
View File
@@ -4767,7 +4767,7 @@ class Scheduler(
# (queues parked under KV pressure / disagg transfer) has no
# process_batch_result to publish the growing gauge, and gating here
# froze /get_loads, DP balancing, and the LoadStat for the stall. This
# path spins without sleeping, so a wall-clock floor bounds the
# path is polled repeatedly, so a wall-clock floor bounds the
# O(queue) get_loads for both sinks; the fully-idle publish runs
# post-flush below.
fully_idle = self.is_fully_idle()
@@ -4780,6 +4780,10 @@ class Scheduler(
self.load_publisher.publish_load_stat(
self.load_inquirer.get_loads, force=True, snapshot=snapshot
)
if self.enable_hicache_storage:
# Storage workers need the GIL between I/O calls. Yield while
# there is no GPU batch so polling cannot starve their acks.
time.sleep(0)
return
self.metrics_reporter.record_scheduler_idle()