[Bugfix][Core]Fix block table out-of-range issue in priority scheduling (#26661)

Signed-off-by: quanliu <18646313696@163.com>
This commit is contained in:
quanliu 2025-10-13 09:25:42 +08:00 committed by GitHub
parent 60e419c1ee
commit 41f3884438
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -271,6 +271,9 @@ class Scheduler(SchedulerInterface):
self.running.remove(preempted_req)
if preempted_req in scheduled_running_reqs:
scheduled_running_reqs.remove(preempted_req)
token_budget += num_scheduled_tokens[preempted_req.request_id]
req_to_new_blocks.pop(preempted_req.request_id)
num_scheduled_tokens.pop(preempted_req.request_id)
else:
preempted_req = self.running.pop()