mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-17 09:34:48 +00:00
* fix(logging): retain streaming success logging tasks until they finish Streaming chat, A2A, Gemini/Vertex and the proxy's deferred chat stream logging scheduled their success dispatch with a bare asyncio.create_task. The loop only holds weak references to tasks, so a dispatch suspended on an awaitable nothing else reaches could be garbage collected mid-flight and its spend log never written. Route them through spawn_logging_task, which keeps a strong reference until completion, logs failures and is drained at proxy shutdown. * test(logging): release parked logging callbacks on every exit path Wrap the garbage collection regressions in a context manager that releases the parked callback, waits for its task and drains the logging registry even when the test fails, assert exactly one parked callback, and leave the orphaned closure dispatch on its original schedule. * test(logging): cancel a parked logging callback that never finishes Cancel and await the parked task if it is still pending after release, fail the test in that case, and leave the streaming cache write on its original schedule since it hands off to an already tracked write without suspending. --------- Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| helpers | ||
| prisma_and_spend | ||
| proxy_logging | ||
| __init__.py | ||