From 70d01a6e4cac328295e336b3b48e38c8452cbda6 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Thu, 21 May 2026 01:29:48 +0000 Subject: [PATCH] fix(rubrik): drop RUBRIK_MAX_QUEUE_SIZE env knob, hardcode 10k cap The doc-validation CI scans for os.getenv() calls and requires each key to appear in litellm-docs config_settings.md. Adding the env var here without a matching docs PR fails the docs and code-quality checks, and the extra env-parsing block in __init__ also tripped ruff PLR0915. The hard cap at 10k still bounds memory on a Rubrik webhook outage, which is the actual bug being fixed -- operators don't need to tune this knob to get the safety guarantee. --- litellm/integrations/rubrik.py | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/litellm/integrations/rubrik.py b/litellm/integrations/rubrik.py index df5b020d61f..dc607e5c78e 100644 --- a/litellm/integrations/rubrik.py +++ b/litellm/integrations/rubrik.py @@ -37,7 +37,7 @@ if TYPE_CHECKING: _ENDPOINT_ANTHROPIC_MESSAGES = "/v1/messages" _WEBHOOK_PATH_TOOL_BLOCKING = "/v1/after_completion/openai/v1" _WEBHOOK_PATH_LOGGING_BATCH = "/v1/litellm/batch" -_DEFAULT_MAX_QUEUE_SIZE = 10_000 +_MAX_QUEUE_SIZE = 10_000 _DROP_WARNING_INTERVAL_SECONDS = 60.0 @@ -101,23 +101,7 @@ class RubrikLogger(CustomGuardrail, CustomBatchLogger): # authenticated traffic accumulate prompt/response payloads until the # proxy runs out of memory. Once the cap is reached, oldest events are # dropped to make room for fresh ones (drop-oldest backpressure). - self.max_queue_size = _DEFAULT_MAX_QUEUE_SIZE - _max_queue_size = os.getenv("RUBRIK_MAX_QUEUE_SIZE") - if _max_queue_size: - try: - parsed_max = int(_max_queue_size) - if parsed_max > 0: - self.max_queue_size = parsed_max - else: - verbose_logger.warning( - f"RUBRIK_MAX_QUEUE_SIZE={_max_queue_size!r} must be > 0; " - f"using default {_DEFAULT_MAX_QUEUE_SIZE}" - ) - except ValueError: - verbose_logger.warning( - f"Invalid RUBRIK_MAX_QUEUE_SIZE: {_max_queue_size!r}, " - f"using default {_DEFAULT_MAX_QUEUE_SIZE}" - ) + self.max_queue_size = _MAX_QUEUE_SIZE self._dropped_since_warning = 0 self._last_drop_warning_time = 0.0