[PR #9931] [MERGED] ollama: fix file descriptor management in Pull #13100

Closed
opened 2026-04-13 00:18:04 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9931
Author: @bmizerany
Created: 3/21/2025
Status: Merged
Merged: 3/21/2025
Merged by: @bmizerany

Base: mainHead: bmizerany/client2closefilessooner


📝 Commits (1)

  • 874da96 ollama: fix file descriptor management in Pull

📊 Changes

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

View changed files

📝 server/internal/client/ollama/registry.go (+31 -25)

📄 Description

Close chunked writers as soon as downloads complete, rather than deferring closure until Pull exits. This prevents exhausting file descriptors when pulling many layers.

Instead of unbounded defers, use a WaitGroup and background goroutine to close each chunked writer as soon as its downloads finish.

Also rename 'total' to 'received' for clarity.


🔄 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/9931 **Author:** [@bmizerany](https://github.com/bmizerany) **Created:** 3/21/2025 **Status:** ✅ Merged **Merged:** 3/21/2025 **Merged by:** [@bmizerany](https://github.com/bmizerany) **Base:** `main` ← **Head:** `bmizerany/client2closefilessooner` --- ### 📝 Commits (1) - [`874da96`](https://github.com/ollama/ollama/commit/874da96e5c6e91bc6f279a5b30c48f22435a976b) ollama: fix file descriptor management in Pull ### 📊 Changes **1 file changed** (+31 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `server/internal/client/ollama/registry.go` (+31 -25) </details> ### 📄 Description Close chunked writers as soon as downloads complete, rather than deferring closure until Pull exits. This prevents exhausting file descriptors when pulling many layers. Instead of unbounded defers, use a WaitGroup and background goroutine to close each chunked writer as soon as its downloads finish. Also rename 'total' to 'received' for clarity. --- <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-13 00:18:04 -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#13100