[Fix] rust-server: Answer health probes a busy scheduler skipped on the response ring (#45475)
Co-authored-by: Lu Fang <116399278+luccafong@users.noreply.github.com> Co-authored-by: shodoco <shodoco@users.noreply.github.com>
This commit is contained in:
co-authored by
Lu Fang
shodoco
parent
5bf10d4c79
commit
ca72dad953
@@ -5108,11 +5108,18 @@ class Scheduler(
|
||||
# Return some signal for the health check.
|
||||
# This is used to prevent the health check signal being blocked by long context prefill.
|
||||
# However, one minor issue is that this code path does not check the status of detokenizer manager.
|
||||
self.ipc_channels.send_to_tokenizer.send_output(
|
||||
HealthCheckOutput(
|
||||
http_worker_ipc=self.return_health_check_ipcs.popleft()
|
||||
if self.rust_server is not None:
|
||||
# The zmq tokenizer socket is not consumed in Rust mode. Rust
|
||||
# probes share one heartbeat, so one acknowledgement answers
|
||||
# every probe skipped so far.
|
||||
self.return_health_check_ipcs.clear()
|
||||
self.rust_server.push_health_ack()
|
||||
else:
|
||||
self.ipc_channels.send_to_tokenizer.send_output(
|
||||
HealthCheckOutput(
|
||||
http_worker_ipc=self.return_health_check_ipcs.popleft()
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
def add_external_corpus(
|
||||
self, recv_req: AddExternalCorpusReqInput
|
||||
|
||||
@@ -383,6 +383,10 @@ class RustServer:
|
||||
|
||||
self.server.push_control_result(recv_req.rid, encoded)
|
||||
|
||||
def push_health_ack(self) -> None:
|
||||
"""Acknowledge the health probes skipped while the scheduler was busy."""
|
||||
self.server.push_health_ack()
|
||||
|
||||
def push_generation(self, payload: BatchTokenIDOutput) -> None:
|
||||
"""Egress redirect for generation output (replaces the zmq detokenizer).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user