[PR #14840] [MERGED] runner: fix swallowed error in allocModel graph reservation #61566

Closed
opened 2026-04-29 16:38:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14840
Author: @mango766
Created: 3/14/2026
Status: Merged
Merged: 3/16/2026
Merged by: @jessegross

Base: mainHead: fix/allocmodel-swallowed-error


📝 Commits (1)

  • 476ee19 runner: fix swallowed error in allocModel graph reservation

📊 Changes

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

View changed files

📝 runner/ollamarunner/runner.go (+1 -1)

📄 Description

Summary

Fixes #14839

allocModel() silently discards the error from the first reserveWorstCaseGraph(true) call by returning nil instead of err. This means a failed prompt graph reservation goes unnoticed — the model appears to load successfully but may behave unexpectedly during inference.

Before (bug):

err = s.reserveWorstCaseGraph(true)
if err != nil {
    return nil  // error swallowed
}

After (fix):

err = s.reserveWorstCaseGraph(true)
if err != nil {
    return err  // error properly propagated
}

The second call reserveWorstCaseGraph(false) already returns its error correctly, so this was likely a typo.

Test plan

  • Verified the fix is a single-character change (nil -> err) with no side effects
  • Existing tests continue to pass (the change only affects the error path)
  • Under memory pressure, allocModel now correctly reports failure instead of silently proceeding

🤖 Generated with Claude Code


🔄 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/14840 **Author:** [@mango766](https://github.com/mango766) **Created:** 3/14/2026 **Status:** ✅ Merged **Merged:** 3/16/2026 **Merged by:** [@jessegross](https://github.com/jessegross) **Base:** `main` ← **Head:** `fix/allocmodel-swallowed-error` --- ### 📝 Commits (1) - [`476ee19`](https://github.com/ollama/ollama/commit/476ee19ae9e09a70a8753d7fb6e11e9220f148b6) runner: fix swallowed error in allocModel graph reservation ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `runner/ollamarunner/runner.go` (+1 -1) </details> ### 📄 Description ## Summary Fixes #14839 `allocModel()` silently discards the error from the first `reserveWorstCaseGraph(true)` call by returning `nil` instead of `err`. This means a failed prompt graph reservation goes unnoticed — the model appears to load successfully but may behave unexpectedly during inference. **Before (bug):** ```go err = s.reserveWorstCaseGraph(true) if err != nil { return nil // error swallowed } ``` **After (fix):** ```go err = s.reserveWorstCaseGraph(true) if err != nil { return err // error properly propagated } ``` The second call `reserveWorstCaseGraph(false)` already returns its error correctly, so this was likely a typo. ## Test plan - [x] Verified the fix is a single-character change (`nil` -> `err`) with no side effects - [ ] Existing tests continue to pass (the change only affects the error path) - [ ] Under memory pressure, `allocModel` now correctly reports failure instead of silently proceeding 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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-29 16:38:30 -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#61566