Update litellm/proxy/common_request_processing.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
harish-berri 2026-05-04 17:40:16 -07:00 committed by GitHub
parent 9fc9e433f2
commit d2c0585f7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1235,15 +1235,15 @@ class ProxyBaseLLMRequestProcessing:
# upstream connection is established; the ASGI transport layer handles
# cancellation of the upstream when the client disconnects mid-stream.
responses = await llm_responses
disconnect_task.cancel()
except asyncio.CancelledError:
disconnect_task.cancel()
if disconnect_event.is_set():
raise HTTPException(
status_code=499,
detail="Client disconnected the request",
)
raise
finally:
disconnect_task.cancel()
response = responses[1]