17 views
-/https://github.com/berriai/litellm/issues/22100
GitHub ยท issue

#22100 [Bug]: asyncio.CancelledError in aiohttp transport bypasses retry logic, logging, and exception mapping

  • State: open
  • Author: @sapirm-eleos
  • Labels: bug, proxy, llm translation

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

When using the /v1/responses endpoint with the aiohttp transport (default), intermittent asyncio.CancelledError exceptions during DNS resolution are not caught by any error handling layer in LiteLLM. This results in a bare 500 returned to the client with no retries, no logging, and no visibility in the LiteLLM UI. We don't even know why these errors happen in the first place, but some logging / retry is a must for debugging it.

Root cause:

asyncio.CancelledError inherits from BaseException (Python 3.9+), not Exception. Three layers all miss it:

1. aiohttp_transport.py โ†’ map_aiohttp_exceptions โ€” catches Exception, so CancelledError passes through 2. router.py โ†’ _acompletion โ€” catches Exception for retry/logging, so CancelledError is never logged or retried 3. proxy_server.py โ†’ openai_exception_handler โ€” catches ProxyException only

Impact:

- Router does not retry on a different deployment (even though other healthy deployments are available) - No log entry anywhere โ€” not in proxy logs, not in the LiteLLM UI spend logs - Client โ€ฆ

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 ยท 31d18h10m54s ago โ€” entered ยท #import:https:::github.com:berriai:litellm post #2887
The right issue is harder because it requires coordinated schema, migration, data-integrity, and database-behavior changes with production-scale cleanup and compatibility risk. The left issue is narrower, primarily involving exception semantics across existing async error-handling paths and targeted regression tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search