mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-24 22:09:56 +00:00
* fix: safely reuse and retire generic API loggers * test: cover generic API logger reuse and rotation * fix(proxy): unregister the current generic API logger after its headers rotate Removing a database-configured generic API callback after a header rotation put the retired logger back, and it kept sending logs through its replacement. The database callback sync now compares and removes callbacks by the logger that is currently active * fix(logging): let a retired generic API logger finish its sends and move its cache tests A header change used to give the old logger 30 seconds to finish, then cancel it and drop any logs still queued on it, even when its own timeout and retries allowed longer. The old logger now finishes its last sends under its own send settings The cache tests move into the existing logging callback manager test file, with typed parameters and settings swapped in through monkeypatch * fix(logging): hand a retired generic API logger's queued logs to its replacement Logs still queued when a header change retires a logger now go out through the new logger with the new header. Also drop the flush_queue test double, add Final to the proxy test, and cover both current-logger mappings in DB callback sync * fix(logging): send queued logs with the old config when the new logger filters their event types * test(logging): read delivered logs and headers through one helper * fix(logging): check the hand-off target's event types under the flush lock * fix(logging): stop retired loggers from resending queued logs or rejoining callback lists * fix(logging): read the cached generic API logger under the callback lock Two threads rotating the same logger could each build a replacement, leaving a listed logger that is not the cached one. Also drop a no-op mapping of displaced database callbacks, which are only ever strings, and add a regression test for a file callback that rotates during database registration --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_generic_api_callback.py | ||