Skip to content

fix(proxy): unregister logging callbacks removed from the stored config on rc/1.104.0 - #43432

Merged
yuneng-berri merged 1 commit into
rc/1.104.0from
litellm_rc_1_104_0_callback_delete_sticks
Sep 27, 2026
Merged

yuneng-berri merged 1 commit into
rc/1.104.0from
litellm_rc_1_104_0_callback_delete_sticks

Conversation

@yuneng-berri

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • On rc/1.104.0, deleting a logging callback reports success but it keeps exporting
  • The deleted callback stays listed in the Admin UI's callback list

How it solves it:

User Flow

Before: an admin deletes a logging callback, gets a success message, and the proxy keeps exporting to it

  1. They add langfuse_otel with POST http://localhost:4000/config/update and traffic starts reaching Langfuse
  2. They delete it with POST http://localhost:4000/config/callback/delete and get Successfully deleted callback: langfuse_otel
  3. GET http://localhost:4000/get/config/callbacks keeps listing langfuse_otel on every worker
  4. New chat completions keep exporting to Langfuse

After: the delete sticks on every worker

  1. They add langfuse_otel with POST http://localhost:4000/config/update and traffic starts reaching Langfuse
  2. They delete it with POST http://localhost:4000/config/callback/delete and get Successfully deleted callback: langfuse_otel
  3. GET http://localhost:4000/get/config/callbacks returns an empty list on every worker within 30 seconds
  4. New chat completions export nothing, and adding the callback back makes exports resume

Relevant 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

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. 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
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

The proxy_server.py hunks are identical to #43429. The only cherry-pick conflict was placement in test_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)

  1. Not re-run live on rc/1.104.0. The rc/1.103.0 run in fix(proxy): unregister logging callbacks removed from the stored config #43429 shows the bug with the same /config/update, /config/callback/delete and /get/config/callbacks calls: the deleted langfuse_otel stays listed on every worker and keeps exporting after 35 seconds

After (b99c63d)

  1. 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" returns 14 passed
  2. Not re-run live on rc/1.104.0. The rc/1.103.0 run in fix(proxy): unregister logging callbacks removed from the stored config #43429 shows the same calls returning [] from /get/config/callbacks and 0 export batches after the delete

Type

🐛 Bug Fix

Caveats (if any)

Medium

Low

  • Non-string entries in the stored callback lists are now ignored instead of registered

…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)
@greptile-apps

greptile-apps Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Fixes callback registration cleanup in the proxy config system.

The PR appears safe to merge, though deleted S3 callbacks should have their background flush lifecycle addressed.

Findings

  1. P2 S3 flush continues after deletion ▶

Summary

The PR reconciles registered callbacks against stored configuration on each successful sync, removing callbacks whose stored entries were deleted while preserving callbacks registered elsewhere. It adds tests for deletion, non-DB registrations, and failed config reads.

Reviews (1) · Last reviewed commit: "fix(proxy): unregister logging callbacks..."

Comment on lines +7267 to +7269
litellm.logging_callback_manager.remove_callback_from_list_by_object(
getattr(litellm, list_name), entry, require_self=False
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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

@yuneng-berri
yuneng-berri merged commit a76395e into rc/1.104.0 Sep 27, 2026
7 of 8 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_rc_1_104_0_callback_delete_sticks branch September 27, 2026 08:03

This branch had an error being deployed

1 failed deployment
e2e-changed — b99c63d7 Deployed Sep 27, 2026 by yuneng-berri via oauth #1526
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant