In this article
Trace a cancelled rerank through the client, gateway and upstream connection with cancel_on_disconnect enabled; keep disabled-policy behavior as a control.
The November 15 LiteLLM v1.111.0-dev.4 prerelease extends configured disconnect cancellation to rerank endpoints. Previously an abandoned rerank could keep its upstream request alive. For retrieval applications, the acceptance boundary spans the caller, gateway and provider connection; a cancelled browser or application task alone does not demonstrate upstream cancellation.
Use a provider that exposes its lifetime
A harmless mock reranker can wait after receiving the query and documents while recording connection closure. Start a request, confirm upstream receipt and then disconnect the client deliberately. Compare the configured cancellation path with the disabled setting. This identifies where work actually stops and avoids treating a client timeout message as evidence that the gateway released provider capacity.
Retries must follow the chosen cancellation policy
Configure a visible retry budget and observe whether the abandoned request creates another upstream attempt. Record attempt identities rather than relying on an aggregate count. A retrieval service with a short deadline can otherwise leave work running after its result is no longer useful. The proposed fixture checks resource cleanup and retry interaction; it does not assert that closing a connection always refunds provider-side work already completed.
Observe logs without inventing a completed result
Inspect the request’s final log status and usage attribution after cancellation. Retain the query and document counts as synthetic diagnostic values. The PR discusses logging for an upstream call that has already received input, so a missing answer does not necessarily mean zero work. Ensure downstream analytics distinguish abandoned retrieval from a valid ranked response and from a provider timeout that happened while the caller remained connected.
Test the entire retrieval deadline
Place the fixture inside the application’s retrieval chain and cancel during reranking rather than during an earlier embedding call. Verify that later generation does not start from an incomplete ranking. Report the exact prerelease and setting. The useful outcome is a known cleanup path for expired retrieval work, with timing and accounting evidence, rather than an unsupported claim that cancellation guarantees provider compute termination or cost elimination.
Sources
Related reading
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.