[PR #1182] [CLOSED] serve: poll cancellation during quiet prefill waits #3290

Closed
opened 2026-11-07 14:40:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1182
Author: @hulkbig
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: fix/quiet-prefill-cancel-20261006


📝 Commits (1)

  • d4dbc34 serve: poll cancellation during quiet prefill waits

📊 Changes

2 files changed (+242 additions, -5 deletions)

View changed files

📝 serve/server.py (+16 -5)
➕ serve/test_quiet_cancel.py (+226 -0)

📄 Description

Refs #962

While the native process is quiet before its first prompt-progress line or token, the Python server can wait ten seconds before checking a client's cancellation event. Poll the pipe in waits of at most 0.5 seconds while retaining the ten-second HTTP heartbeat and existing STOP / DONE / BADM cleanup ownership.

The regression tests use real HTTP disconnects and a scripted native subprocess. They cover serial generation, batch solo generation and batch admission across the three API endpoints, streaming and non-streaming; the following request must receive its own output. Additional tests preserve heartbeat cadence and silence deadlines.

Validation on macOS arm64 / Python 3.12.12: python -m unittest serve.test_quiet_cancel serve.test_control_cancel serve.test_parallel serve.test_restart_waiters -v — 30 tests passed. git diff HEAD^ HEAD --check passed.

This addresses the server-side quiet wait only. Actual CUDA/HIP prefill interruption, model execution and Claude Code cancellation behavior have not been tested, so this does not claim to fully resolve #962.

Developed, tested and reviewed with OpenAI coding assistants.


🔄 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/Niko1221/Strata/pull/1182 **Author:** [@hulkbig](https://github.com/hulkbig) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/quiet-prefill-cancel-20261006` --- ### 📝 Commits (1) - [`d4dbc34`](https://github.com/Niko1221/Strata/commit/d4dbc34cc5574e8127d81e0429a5adb65ddb9b7c) serve: poll cancellation during quiet prefill waits ### 📊 Changes **2 files changed** (+242 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `serve/server.py` (+16 -5) ➕ `serve/test_quiet_cancel.py` (+226 -0) </details> ### 📄 Description Refs #962 While the native process is quiet before its first prompt-progress line or token, the Python server can wait ten seconds before checking a client's cancellation event. Poll the pipe in waits of at most 0.5 seconds while retaining the ten-second HTTP heartbeat and existing STOP / DONE / BADM cleanup ownership. The regression tests use real HTTP disconnects and a scripted native subprocess. They cover serial generation, batch solo generation and batch admission across the three API endpoints, streaming and non-streaming; the following request must receive its own output. Additional tests preserve heartbeat cadence and silence deadlines. Validation on macOS arm64 / Python 3.12.12: `python -m unittest serve.test_quiet_cancel serve.test_control_cancel serve.test_parallel serve.test_restart_waiters -v` — 30 tests passed. `git diff HEAD^ HEAD --check` passed. This addresses the server-side quiet wait only. Actual CUDA/HIP prefill interruption, model execution and Claude Code cancellation behavior have not been tested, so this does not claim to fully resolve #962. Developed, tested and reviewed with OpenAI coding assistants. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:40:24 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3290
No description provided.