From 810d4f9c22319491cd3ac360afed6d2cae6be99a Mon Sep 17 00:00:00 2001 From: easonysliu Date: Sat, 14 Mar 2026 10:35:40 +0800 Subject: [PATCH] runner: fix swallowed error in allocModel graph reservation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In allocModel(), the first call to reserveWorstCaseGraph(true) had its error silently discarded — `return nil` was used instead of `return err`. This meant that if the prompt-sized graph reservation failed (e.g. due to insufficient memory), the error was swallowed, allocModel reported success, and the model appeared to load correctly. Subsequent inference would then fail in unexpected ways because the worst-case graph was never properly reserved. Fix: return the actual error so the caller can handle the failure (retry with reduced parallelism, report OOM, etc.). Co-Authored-By: Claude (claude-opus-4-6) --- runner/ollamarunner/runner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runner/ollamarunner/runner.go b/runner/ollamarunner/runner.go index ffaf8ec5..49e4a5ed 100644 --- a/runner/ollamarunner/runner.go +++ b/runner/ollamarunner/runner.go @@ -1231,7 +1231,7 @@ func (s *Server) allocModel( err = s.reserveWorstCaseGraph(true) if err != nil { - return nil + return err } return s.reserveWorstCaseGraph(false)