[PD] Abort request if transfer fails (#6504)

This commit is contained in:
Byron Hsu
2025-05-21 21:44:25 -07:00
committed by GitHub
parent 7513558074
commit 3bde101099
5 changed files with 84 additions and 4 deletions

View File

@@ -50,6 +50,7 @@ from sglang.srt.disaggregation.utils import (
DisaggregationMode,
ReqToMetadataIdxAllocator,
TransferBackend,
prepare_abort,
)
from sglang.srt.distributed import get_pp_group, get_world_group
from sglang.srt.hf_transformers_utils import (
@@ -935,6 +936,18 @@ class Scheduler(
)
req.tokenizer = self.tokenizer
if self.disaggregation_mode != DisaggregationMode.NULL:
# Invalid request for disaggregated mode
if recv_req.bootstrap_room is None:
error_message = (
f"Invalid request: Disaggregated request received without "
f"boostrap room id. {req.rid=}"
)
logger.error(error_message)
prepare_abort(req, error_message)
self.stream_output([req], req.return_logprob)
return
if (
recv_req.session_params is not None
and recv_req.session_params.id is not None