Repository navigation
fix(proxy): unregister logging callbacks removed from the stored config on rc/1.104.0 - #43432
Conversation
…ig (#43429) * fix(proxy): unregister logging callbacks removed from the stored config POST /config/callback/delete saved the config and resynced, but the resync only ever added callbacks, so a deleted callback kept exporting and kept showing in /get/config/callbacks as read-only on every worker. ProxyConfig now tracks which callback list entries each DB config sync registered and unregisters them once the stored config stops listing them. Callbacks it did not register (YAML, code) are never touched, and a failed config load skips the sync instead of treating the config as empty. * refactor(proxy): keep callback sync comprehensions to one for clause (cherry picked from commit c991f4b)
|
| litellm.logging_callback_manager.remove_callback_from_list_by_object( | ||
| getattr(litellm, list_name), entry, require_self=False | ||
| ) |
There was a problem hiding this comment.
S3 flush continues after deletion
Deleting an s3_v2 callback removes it from LiteLLM’s callback lists, but the cached S3 logger still has a periodic flush task. It can upload records already in its queue after the admin deletes the destination, and the task remains active until worker shutdown. Please stop or drain that logger during unregistration.
Knowledge Base Used: Logging callbacks and telemetry
TLDR
Problem this solves:
How it solves it:
User Flow
Before: an admin deletes a logging callback, gets a success message, and the proxy keeps exporting to it
langfuse_otelwith POST http://localhost:4000/config/update and traffic starts reaching LangfuseSuccessfully deleted callback: langfuse_otellangfuse_otelon every workerAfter: the delete sticks on every worker
langfuse_otelwith POST http://localhost:4000/config/update and traffic starts reaching LangfuseSuccessfully deleted callback: langfuse_otelRelevant issues
Mirror of #43429 onto rc/1.104.0. Upstream is #43428
Affected release
The read-only listing appears since v1.102.0-rc.1 (#38974). The leftover exports are older and also happen on v1.101.0
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)The
proxy_server.pyhunks are identical to #43429. The only cherry-pick conflict was placement intest_proxy_server.py: rc/1.104.0 has two DB callback-params tests at the same spot, so both sets are kept. The new tests plus those neighbours pass on this branch (14 passed)Screenshots / Proof of Fix
Before (1df3f10)
/config/update,/config/callback/deleteand/get/config/callbackscalls: the deletedlangfuse_otelstays listed on every worker and keeps exporting after 35 secondsAfter (b99c63d)
pytest tests/test_litellm/proxy/test_proxy_server.py -k "unregisters_a_callback or keeps_callbacks_it_did_not or failed_config_load_keeps or db_stored"returns14 passed[]from/get/config/callbacksand 0 export batches after the deleteType
🐛 Bug Fix
Caveats (if any)
Medium
Low