[PR #3169] [CLOSED] feat: timeout between token generation #73381

Closed
opened 2026-05-05 05:11:35 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/3169
Author: @BruceMacD
Created: 3/15/2024
Status: Closed

Base: mainHead: brucemacd/token-gen-timeout


📝 Commits (2)

  • de0f833 feat: timeout between token generation
  • 4ad24c6 Update dyn_ext_server.go

📊 Changes

2 files changed (+72 additions, -44 deletions)

View changed files

📝 llm/dyn_ext_server.go (+63 -44)
📝 server/routes.go (+9 -0)

📄 Description

  • if 30 seconds pass since the last token generation abort the request
  • stop the llama thread to flush any accumulated context

This is an attempt to mitigate server hangs as seen in #2805. It is not a complete solution since we still need to address the root cause of the hangs, but it will make them recoverable.

TODO:

  • reproduce hang and validate this allows the server to recover

🔄 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/3169 **Author:** [@BruceMacD](https://github.com/BruceMacD) **Created:** 3/15/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `brucemacd/token-gen-timeout` --- ### 📝 Commits (2) - [`de0f833`](https://github.com/ollama/ollama/commit/de0f833ce38c51374c39aa37c229605c4bc8d221) feat: timeout between token generation - [`4ad24c6`](https://github.com/ollama/ollama/commit/4ad24c6ca6341115261390d05dd05c06bc8705d3) Update dyn_ext_server.go ### 📊 Changes **2 files changed** (+72 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `llm/dyn_ext_server.go` (+63 -44) 📝 `server/routes.go` (+9 -0) </details> ### 📄 Description - if 30 seconds pass since the last token generation abort the request - stop the llama thread to flush any accumulated context This is an attempt to mitigate server hangs as seen in #2805. It is not a complete solution since we still need to address the root cause of the hangs, but it will make them recoverable. TODO: - [ ] reproduce hang and validate this allows the server to recover --- <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-05-05 05:11:35 -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#73381