diff --git a/litellm/_redis.py b/litellm/_redis.py index 652841626631..5ab551453bb3 100644 --- a/litellm/_redis.py +++ b/litellm/_redis.py @@ -100,6 +100,8 @@ def _get_redis_cluster_kwargs(client=None): "azure_tenant_id", "azure_client_secret", "max_connections", + "socket_timeout", + "socket_connect_timeout", } return available_args diff --git a/tests/test_litellm/test_redis.py b/tests/test_litellm/test_redis.py index 282c9d72d516..a89e30a0e06b 100644 --- a/tests/test_litellm/test_redis.py +++ b/tests/test_litellm/test_redis.py @@ -1,5 +1,4 @@ import json -import os from unittest.mock import MagicMock, patch import pytest @@ -165,6 +164,13 @@ def test_max_connections_in_cluster_kwargs(): ), "max_connections should be in available Redis cluster kwargs" +def test_socket_timeouts_in_cluster_kwargs(): + """Test that Redis cluster clients can receive socket timeout configuration""" + kwargs = _get_redis_cluster_kwargs() + assert "socket_timeout" in kwargs + assert "socket_connect_timeout" in kwargs + + def test_get_redis_async_client_with_connection_pool(): """Test that connection_pool parameter is properly passed to Redis client""" # Create a mock connection pool