[PR #10487] [MERGED] Fix "Stopping..." scheduler hang #39128

Closed
opened 2026-04-22 23:46:24 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/10487
Author: @dhiltgen
Created: 4/29/2025
Status: Merged
Merged: 4/30/2025
Merged by: @dhiltgen

Base: mainHead: sched


📝 Commits (2)

  • f6405c7 Adjust initial scheduler refCount
  • e711380 sched: fix lock order inversion deadlock

📊 Changes

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

View changed files

📝 server/sched.go (+9 -8)

📄 Description

This fixes a race condition due to lock inversion which resulted in models failing to unload and reporting "Stopping..." indefinitely until the ollama server was killed.

The primary bug was updateFreeSpace getting stuck while another model was unloading.

Fixes #7606
Fixes #8178
Fixes #8969
Fixes #9617
Fixes #10119


🔄 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/10487 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 4/29/2025 **Status:** ✅ Merged **Merged:** 4/30/2025 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `sched` --- ### 📝 Commits (2) - [`f6405c7`](https://github.com/ollama/ollama/commit/f6405c7d6a6f714b7320e7d6363290bbfcaeea22) Adjust initial scheduler refCount - [`e711380`](https://github.com/ollama/ollama/commit/e7113802440c13f94650c652924c86a86ebb2112) sched: fix lock order inversion deadlock ### 📊 Changes **1 file changed** (+9 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `server/sched.go` (+9 -8) </details> ### 📄 Description This fixes a race condition due to lock inversion which resulted in models failing to unload and reporting "Stopping..." indefinitely until the ollama server was killed. The primary bug was updateFreeSpace getting stuck while another model was unloading. Fixes #7606 Fixes #8178 Fixes #8969 Fixes #9617 Fixes #10119 --- <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-22 23:46: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#39128