From 9febf728dfbd03e1ff6d5e256ec02e6056ecb205 Mon Sep 17 00:00:00 2001 From: Vikas Sharma Date: Thu, 16 Jul 2026 21:33:55 +0530 Subject: [PATCH] fix: bound inflight report threads with semaphore Add _MAX_INFLIGHT semaphore (cap=10) so thread spawning is bounded during mass failures. If 10 reports are already in flight, new ones are silently dropped instead of exhausting OS thread limits. --- litellm/integrations/tickerr.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/litellm/integrations/tickerr.py b/litellm/integrations/tickerr.py index 27f7227a00e..c3f0114ed76 100644 --- a/litellm/integrations/tickerr.py +++ b/litellm/integrations/tickerr.py @@ -23,6 +23,7 @@ from litellm.llms.custom_httpx.http_handler import _get_httpx_client _REPORT_URL = "https://tickerr.ai/api/v1/report" _UA = "litellm-tickerr/1.0" +_MAX_INFLIGHT = threading.Semaphore(10) class TickerrLogger(CustomLogger): @@ -124,6 +125,8 @@ class TickerrLogger(CustomLogger): } def _send() -> None: + if not _MAX_INFLIGHT.acquire(blocking=False): + return try: client = _get_httpx_client() client.post( @@ -134,5 +137,7 @@ class TickerrLogger(CustomLogger): ) except Exception: pass + finally: + _MAX_INFLIGHT.release() threading.Thread(target=_send, daemon=True).start()