[PR #81] [MERGED] fix race #56669

Closed
opened 2026-04-29 11:12:29 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/81
Author: @mxyng
Created: 7/14/2023
Status: Merged
Merged: 7/14/2023
Merged by: @mxyng

Base: mainHead: fix-race-2


📝 Commits (1)

📊 Changes

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

View changed files

📝 server/routes.go (+26 -31)

📄 Description

block on write which only returns when the channel is closed. this is contrary to the previous arrangement where the handler may return but the stream hasn't finished writing. it can lead to the client receiving unexpected responses (since the request has been handled) or worst case a nil-pointer dereference as the stream tries to flush a nil writer


🔄 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/81 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 7/14/2023 **Status:** ✅ Merged **Merged:** 7/14/2023 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `fix-race-2` --- ### 📝 Commits (1) - [`5ade3db`](https://github.com/ollama/ollama/commit/5ade3db040b96b4c618e080aaf273aeec9f8edd1) fix race ### 📊 Changes **1 file changed** (+26 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `server/routes.go` (+26 -31) </details> ### 📄 Description block on write which only returns when the channel is closed. this is contrary to the previous arrangement where the handler may return but the stream hasn't finished writing. it can lead to the client receiving unexpected responses (since the request has been handled) or worst case a nil-pointer dereference as the stream tries to flush a nil writer --- <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 11:12:29 -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#56669