Skip to content

Gracefully handle connection closed errors during streaming - #16294

Merged
1 commit merged into
mainfrom
litellm_connection_closure_issue
Nov 6, 2025
Merged

Gracefully handle connection closed errors during streaming#16294
1 commit merged into
mainfrom
litellm_connection_closure_issue

Conversation

@AlexsanderHamir

@AlexsanderHamir AlexsanderHamir commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

Title

Gracefully handle connection closed errors during streaming

Relevant issues

addresses #15624

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

  • Catches RuntimeError: Connection closed in the aiohttp transport to prevent crashes during streaming and ensure the stream terminates gracefully.

Test Results

Screenshot 2025-11-05 at 3 20 46 PM
  • Failures seem unrelated.

@vercel

vercel Bot commented Nov 5, 2025

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
litellm Ready Ready Preview Comment Nov 5, 2025 11:19pm

@AlexsanderHamir AlexsanderHamir changed the title fix(aiohttp): Gracefully handle connection closed errors during streaming Gracefully handle connection closed errors during streaming Nov 5, 2025
@ghost
ghost merged commit 263629b into main Nov 6, 2025
32 of 53 checks passed
@ishaan-berri
ishaan-berri deleted the litellm_connection_closure_issue branch March 26, 2026 21:51
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
This pull request was closed.
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.

1 participant