[PR #6986] [MERGED] server: close response body on error #12281

Closed
opened 2026-04-12 23:54:10 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/6986
Author: @bmizerany
Created: 9/26/2024
Status: Merged
Merged: 9/26/2024
Merged by: @bmizerany

Base: mainHead: bmizerany/close


📝 Commits (1)

  • d19120f server: close response body on error

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

📝 server/images.go (+4 -0)

📄 Description

This change closes the response body when an error occurs in makeRequestWithRetry. Previously, the first, non-200 response body was not closed before reattempting the request. This change ensures that the response body is closed in all cases where an error occurs, preventing leaks of file descriptors.

Fixes #6974


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/6986 **Author:** [@bmizerany](https://github.com/bmizerany) **Created:** 9/26/2024 **Status:** ✅ Merged **Merged:** 9/26/2024 **Merged by:** [@bmizerany](https://github.com/bmizerany) **Base:** `main` ← **Head:** `bmizerany/close` --- ### 📝 Commits (1) - [`d19120f`](https://github.com/ollama/ollama/commit/d19120f15277ef36e08fb7ff07067bcc3e6f29af) server: close response body on error ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `server/images.go` (+4 -0) </details> ### 📄 Description This change closes the response body when an error occurs in makeRequestWithRetry. Previously, the first, non-200 response body was not closed before reattempting the request. This change ensures that the response body is closed in all cases where an error occurs, preventing leaks of file descriptors. Fixes #6974 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-12 23:54:10 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#12281