[router] leverage RAII to actively cancel request during client disconnect (#11399)
This commit is contained in:
@@ -211,13 +211,6 @@ class SGLangSchedulerServicer(sglang_scheduler_pb2_grpc.SglangSchedulerServicer)
|
||||
)
|
||||
|
||||
async for output in response_generator:
|
||||
# Check if client cancelled before processing/yielding
|
||||
if context.cancelled():
|
||||
logger.info(f"Client cancelled request {request.request_id}")
|
||||
# Explicitly abort the request to notify scheduler
|
||||
await self.request_manager.abort_request(request.request_id)
|
||||
break
|
||||
|
||||
# Handle batch responses (for n>1 non-streaming)
|
||||
if isinstance(output, list):
|
||||
for batch_output in output:
|
||||
|
||||
Reference in New Issue
Block a user