[PR #8890] [CLOSED] Improve Download Stall Handling with Adaptive Retry Mechanism #75101

Closed
opened 2026-05-05 07:30:31 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/8890
Author: @yashwanth2706
Created: 2/6/2025
Status: Closed

Base: mainHead: main


📄 Description

Summary

This pull request improves the stalled download handling mechanism by implementing an adaptive retry strategy with exponential backoff.

Previously, the download process restarted immediately if no packets were received for 30 seconds.
Now, retries follow a progressive delay pattern, allowing slow networks to recover before completely failing.


Changes and Improvements

Dynamic Exponential Backoff for Retries

  • If no packets are received for 30 seconds, the script gradually increases the wait time before retrying instead of restarting instantly.
  • New Retry Intervals:
  • Prevents excessive retries and allows downloads to recover smoothly.

Improved Stall Detection

  • Previous Behavior: Downloads restarted immediately after 30s of inactivity.
  • New Behavior: The system waits progressively longer before failing, improving performance on slow or unreliable networks.

Enhanced Logging for Debugging

Each retry attempt now logs:

  • Part Number
  • Retry Count
  • Maximum Allowed Retries

Example Log Output:

part <part_number> stalled; retrying (attempt <retry_count>/5).
If this persists, press ctrl-c to exit, then 'ollama pull' to find a faster connection.

Why This Change is Necessary

  • Reduces Unnecessary Retries – Prevents constant restarts and improves efficiency.
  • Enhances Stability – Ensures a better experience on slow networks.
  • Optimizes Server Load – Reduces frequent reconnections that can cause strain on the server

🔄 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/8890 **Author:** [@yashwanth2706](https://github.com/yashwanth2706) **Created:** 2/6/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📄 Description ## Summary > This pull request improves the stalled download handling mechanism by implementing an adaptive retry strategy with exponential backoff. Previously, the download process restarted immediately if no packets were received for 30 seconds. Now, retries follow a progressive delay pattern, allowing slow networks to recover before completely failing. --- ## Changes and Improvements ### Dynamic Exponential Backoff for Retries - If no packets are received for 30 seconds, the script **gradually increases** the wait time before retrying instead of restarting instantly. - **New Retry Intervals:** - Prevents excessive retries and allows downloads to recover smoothly. ### Improved Stall Detection - **Previous Behavior:** Downloads restarted **immediately** after 30s of inactivity. - **New Behavior:** The system **waits progressively longer** before failing, improving performance on slow or unreliable networks. ### Enhanced Logging for Debugging Each retry attempt now logs: - **Part Number** - **Retry Count** - **Maximum Allowed Retries** #### Example Log Output: ```shell part <part_number> stalled; retrying (attempt <retry_count>/5). If this persists, press ctrl-c to exit, then 'ollama pull' to find a faster connection. ``` ## Why This Change is Necessary - **Reduces Unnecessary Retries** – Prevents constant restarts and improves efficiency. - **Enhances Stability** – Ensures a better experience on slow networks. - **Optimizes Server Load** – Reduces frequent reconnections that can cause strain on the server --- <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-05-05 07:30:31 -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#75101