[PR #1968] [MERGED] fix: request retry with error #10741

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

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/1968
Author: @mxyng
Created: 1/12/2024
Status: Merged
Merged: 1/16/2024
Merged by: @mxyng

Base: mainHead: mxyng/fix-request-retry


📝 Commits (1)

  • cf29bd2 fix: request retry with error

📊 Changes

1 file changed (+31 additions, -34 deletions)

View changed files

📝 server/images.go (+31 -34)

📄 Description

This fixes a subtle bug with makeRequestWithRetry where an HTTP status error on a retried request will potentially not return the right error.

When a request is retried on Unauthorized, the second request does not go through the same error handling as the first request. For example, if the second request returns with status 404, it returns the request and a nil error while if the first request returns with the same status, it will return a nil request and os.ErrNotExist


🔄 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/1968 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 1/12/2024 **Status:** ✅ Merged **Merged:** 1/16/2024 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/fix-request-retry` --- ### 📝 Commits (1) - [`cf29bd2`](https://github.com/ollama/ollama/commit/cf29bd2d72f70170ef7b5adf6d3e30ac6a23331c) fix: request retry with error ### 📊 Changes **1 file changed** (+31 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `server/images.go` (+31 -34) </details> ### 📄 Description This fixes a subtle bug with makeRequestWithRetry where an HTTP status error on a retried request will potentially not return the right error. When a request is retried on Unauthorized, the second request does not go through the same error handling as the first request. For example, if the second request returns with status 404, it returns the request and a nil error while if the first request returns with the same status, it will return a nil request and os.ErrNotExist --- <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:09:19 -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#10741