[PR #10005] [MERGED] runner: Release semaphore and improve error messages on failures #13116

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

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/10005
Author: @jessegross
Created: 3/26/2025
Status: Merged
Merged: 3/31/2025
Merged by: @jessegross

Base: mainHead: jessegross/semaphore


📝 Commits (1)

  • 97e5694 runner: Release semaphore and improve error messages on failures

📊 Changes

2 files changed (+9 additions, -3 deletions)

View changed files

📝 runner/llamarunner/runner.go (+6 -2)
📝 runner/ollamarunner/runner.go (+3 -1)

📄 Description

If we have an error after creating a new sequence but before finding a slot for it, we return without releasing the semaphore. This reduces our parallel sequences and eventually leads to deadlock.

In practice this should never happen because once we have acquired the semaphore, we should always be able to find a slot. However, the code is clearly not correct.


🔄 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/10005 **Author:** [@jessegross](https://github.com/jessegross) **Created:** 3/26/2025 **Status:** ✅ Merged **Merged:** 3/31/2025 **Merged by:** [@jessegross](https://github.com/jessegross) **Base:** `main` ← **Head:** `jessegross/semaphore` --- ### 📝 Commits (1) - [`97e5694`](https://github.com/ollama/ollama/commit/97e569475e40230f1b04fb40e5817950751a392d) runner: Release semaphore and improve error messages on failures ### 📊 Changes **2 files changed** (+9 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `runner/llamarunner/runner.go` (+6 -2) 📝 `runner/ollamarunner/runner.go` (+3 -1) </details> ### 📄 Description If we have an error after creating a new sequence but before finding a slot for it, we return without releasing the semaphore. This reduces our parallel sequences and eventually leads to deadlock. In practice this should never happen because once we have acquired the semaphore, we should always be able to find a slot. However, the code is clearly not correct. --- <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:24 -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#13116