Skip to content

Conversation

Sameerlite
Copy link
Collaborator

Title

Fix Redis serialization error in SlackAlerting outage alerts

Relevant issues

Fixes LIT-1291

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix

Changes

Problem

When Vertex AI requests timeout (408 errors), LiteLLM attempts to cache outage alert data but fails with:

LiteLLM Redis Caching: async set() - Got exception from REDIS Object of type set is not JSON serializable

This occurs because ProviderRegionOutageModel.deployment_ids is a Python set object, which cannot be JSON serialized for Redis storage.

Solution

Added two helper methods to handle set/list conversion:

  • _prepare_outage_value_for_cache(): Converts sets to lists before caching
  • _restore_outage_value_from_cache(): Converts lists back to sets after retrieval

Changes Made

  • Added helper methods in SlackAlerting class for set/list conversion
  • Updated region_outage_alerts() method to use helper methods for caching
  • Updated outage_alerts() method to use helper methods for caching

@vercel
Copy link

vercel bot commented Oct 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
litellm Ready Ready Preview Comment Oct 20, 2025 6:48pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

@Sameerlite Sameerlite changed the base branch from main to litellm_sameer_oct_staging October 20, 2025 17:56
@Sameerlite
Copy link
Collaborator Author

Closes #15648

@krrishdholakia krrishdholakia merged commit 9d36210 into litellm_sameer_oct_staging Oct 21, 2025
31 of 43 checks passed
@krrishdholakia krrishdholakia deleted the litellm_fix_json_serialize_alreting2 branch October 21, 2025 23:44
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.

2 participants