[PR #2330] [CLOSED] Add fast server stop #21399

Closed
opened 2026-04-19 15:36:51 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/2330
Author: @alpe
Created: 2/2/2024
Status: Closed

Base: mainHead: 2052_killserver


📝 Commits (1)

  • dd1869a Fast server exit on second sigterm/interupt signal

📊 Changes

2 files changed (+42 additions, -13 deletions)

View changed files

📝 main.go (+8 -1)
📝 server/routes.go (+34 -12)

📄 Description

Resolves #2052

First sigterm for a graceful shutdown, second to kill the server.

There are no automated tests for this. Steps to reproduce:
in 1st terminal:

# go build . 
 ./ollama serve

in 2nd terminal

./ollama run llama2

then start a request that takes some seconds: long response 100 words min
While running, do Control-c on terminal 1 twice. Server should exit immediately with code 1.

Also test graceful shutdown with 1 Control-c and wait for end of server response with exit code 0


🔄 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/2330 **Author:** [@alpe](https://github.com/alpe) **Created:** 2/2/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `2052_killserver` --- ### 📝 Commits (1) - [`dd1869a`](https://github.com/ollama/ollama/commit/dd1869a7b883684d2e6218989c3f3646f3793c3e) Fast server exit on second sigterm/interupt signal ### 📊 Changes **2 files changed** (+42 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `main.go` (+8 -1) 📝 `server/routes.go` (+34 -12) </details> ### 📄 Description Resolves #2052 First sigterm for a graceful shutdown, second to kill the server. There are no automated tests for this. Steps to reproduce: in 1st terminal: ```sh # go build . ./ollama serve ``` in 2nd terminal ``` ./ollama run llama2 ``` then start a request that takes some seconds: `long response 100 words min` While running, do `Control-c` on terminal 1 twice. Server should exit immediately with code 1. Also test graceful shutdown with 1 `Control-c` and wait for end of server response with exit code 0 --- <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-19 15:36:51 -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#21399