[PR #8774] [CLOSED] Update download.go #75062

Closed
opened 2026-05-05 07:27:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: mainHead: patch-1


📝 Commits (6)

  • 63b4755 Update download.go
  • c2770eb Update download.go
  • ee10d10 Merge pull request #1 from yashwanth2706/yashwanth2706-patch-1
  • dd93841 Update download.go
  • 82eaf7f Merge branch 'ollama:main' into patch-1
  • 2b93fe0 Formatted download.go to fix indentation and whitespace issues

📊 Changes

1 file changed (+3 additions, -2 deletions)

View changed files

📝 server/download.go (+3 -2)

📄 Description

  1. Current Timeout Check: go if !lastUpdated.IsZero() && time.Since(lastUpdated) > 5*time.Second {

    • Purpose: This line checks if a download part has stalled by comparing the current time with the lastUpdated time.
    • Condition: The if statement evaluates two conditions:
      1. !lastUpdated.IsZero(): Ensures that lastUpdated has been set.
      2. time.Since(lastUpdated) > 5*time.Second: Checks if more than 5 seconds have passed since the last update.
  2. Proposed Change: go if !lastUpdated.IsZero() && time.Since(lastUpdated) > 20*time.Second {

    • Purpose: Increase the stall timeout from 5 seconds to 20 seconds.
    • Reason: To allow more time for packets to be received before considering the download stalled and retrying.

Impact of the Change

  • Increased Timeout: By increasing the timeout to 20 seconds, the system allows more time for packets to be received before it considers the download stalled. This can help prevent premature retries, especially in cases of temporary network slowdowns.
  • Potential Risks: With a longer timeout, if a part of the download is genuinely stalled, the system will take longer to detect and retry, which could delay the overall download process.

Context and Considerations

  • Network Conditions: This change is particularly beneficial in environments with intermittent or slow network connections, as it reduces the likelihood of unnecessary retries.
  • Monitoring: It is advisable to monitor the system's behavior after implementing this change to ensure it resolves the issue without introducing new problems.

🔄 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/8774 **Author:** [@yashwanth2706](https://github.com/yashwanth2706) **Created:** 2/2/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `patch-1` --- ### 📝 Commits (6) - [`63b4755`](https://github.com/ollama/ollama/commit/63b4755fb78e09dc3526dd8ddb49489e7a34ac6d) Update download.go - [`c2770eb`](https://github.com/ollama/ollama/commit/c2770eb95e077a7933149b11faa016681408a68c) Update download.go - [`ee10d10`](https://github.com/ollama/ollama/commit/ee10d106dbdc9603577f75bf7b18327e7fd55518) Merge pull request #1 from yashwanth2706/yashwanth2706-patch-1 - [`dd93841`](https://github.com/ollama/ollama/commit/dd938416fbffd36b0291916845952c3cba6382ef) Update download.go - [`82eaf7f`](https://github.com/ollama/ollama/commit/82eaf7f5ea3a2b848a4a81973cf340107ab1d393) Merge branch 'ollama:main' into patch-1 - [`2b93fe0`](https://github.com/ollama/ollama/commit/2b93fe0b39dc15f59c2cc81ba58f3c0443b0e788) Formatted download.go to fix indentation and whitespace issues ### 📊 Changes **1 file changed** (+3 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `server/download.go` (+3 -2) </details> ### 📄 Description 1. **Current Timeout Check**: ```go if !lastUpdated.IsZero() && time.Since(lastUpdated) > 5*time.Second { ``` - **Purpose**: This line checks if a download part has stalled by comparing the current time with the `lastUpdated` time. - **Condition**: The `if` statement evaluates two conditions: 1. `!lastUpdated.IsZero()`: Ensures that `lastUpdated` has been set. 2. `time.Since(lastUpdated) > 5*time.Second`: Checks if more than 5 seconds have passed since the last update. 2. **Proposed Change**: ```go if !lastUpdated.IsZero() && time.Since(lastUpdated) > 20*time.Second { ``` - **Purpose**: Increase the stall timeout from 5 seconds to 20 seconds. - **Reason**: To allow more time for packets to be received before considering the download stalled and retrying. ### Impact of the Change - **Increased Timeout**: By increasing the timeout to 20 seconds, the system allows more time for packets to be received before it considers the download stalled. This can help prevent premature retries, especially in cases of temporary network slowdowns. - **Potential Risks**: With a longer timeout, if a part of the download is genuinely stalled, the system will take longer to detect and retry, which could delay the overall download process. ### Context and Considerations - **Network Conditions**: This change is particularly beneficial in environments with intermittent or slow network connections, as it reduces the likelihood of unnecessary retries. - **Monitoring**: It is advisable to monitor the system's behavior after implementing this change to ensure it resolves the issue without introducing new problems. --- <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:27:01 -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#75062