[PR #5558] fix(process): reschedule poll on failure and bound stream buffer #6960

Open
opened 2026-11-01 21:44:21 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5558
Author: @ZG0D-FF
Created: 10/20/2026
Status: 🔄 Open

Base: main ← Head: fix/windows-job-process-limits


📝 Commits (3)

  • 477cdb2 fix(process): reschedule poll on failure and bound stream buffer
  • 6bb8573 fix(process): reschedule poll with default cadence to align with test advance window
  • 0353338 fix(process): bound polling retry with backoff and preserve failure lifecycle

📊 Changes

3 files changed (+44 additions, -6 deletions)

View changed files

📝 src/process/ExecFileBoundedOutput.ts (+4 -2)
📝 src/windows/WindowsOwnedProcess.ts (+14 -4)
➕ tests/boundary/process/windowsProcessPollFailure.test.ts (+26 -0)

📄 Description

Summary

Fixes #288, Fixes #2722, Ref #5292.
Eliminates 5000ms cleanup stall when Windows child process polling encounters transient errors, and bounds stream capture allocations to tailLimit.

Problem and expected behavior

  1. On Windows, when child polling errors out, #schedule() was omitted in the catch block, leaving #timer undefined and causing #stop() to wait for the full 5000ms timeout.
  2. In ExecFileBoundedOutput, unchunked streams were concatenated before slicing with .subarray(-tailLimit), allowing unbounded memory growth on high-volume output before truncation.

Change and scope

  1. WindowsOwnedProcess: call this.#schedule(100) in the catch block when this.#closed is false.
  2. ExecFileBoundedOutput: slice chunk to rest.subarray(-tailLimit) before buffer concatenation. Retains child exit code without terminating the process prematurely.

Contract and boundary impact

  • Semantic owner: process
  • Contribution scope fit: bugfix
  • CLI and MCP/tool-catalog contract: none
  • Platform compatibility: Windows (x64) and POSIX

Author readiness

Human owner: @ZG0D-FF

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

🔄 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/morluto/rea/pull/5558 **Author:** [@ZG0D-FF](https://github.com/ZG0D-FF) **Created:** 10/20/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/windows-job-process-limits` --- ### 📝 Commits (3) - [`477cdb2`](https://github.com/morluto/rea/commit/477cdb21729100e05879a06a46de695dcedfe4ac) fix(process): reschedule poll on failure and bound stream buffer - [`6bb8573`](https://github.com/morluto/rea/commit/6bb8573669755b3b030592743e661001283bec0a) fix(process): reschedule poll with default cadence to align with test advance window - [`0353338`](https://github.com/morluto/rea/commit/03533387f4ca28be24840a229284b1c630b6a15e) fix(process): bound polling retry with backoff and preserve failure lifecycle ### 📊 Changes **3 files changed** (+44 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/process/ExecFileBoundedOutput.ts` (+4 -2) 📝 `src/windows/WindowsOwnedProcess.ts` (+14 -4) ➕ `tests/boundary/process/windowsProcessPollFailure.test.ts` (+26 -0) </details> ### 📄 Description ## Summary Fixes #288, Fixes #2722, Ref #5292. Eliminates 5000ms cleanup stall when Windows child process polling encounters transient errors, and bounds stream capture allocations to tailLimit. ## Problem and expected behavior 1. On Windows, when child polling errors out, #schedule() was omitted in the catch block, leaving #timer undefined and causing #stop() to wait for the full 5000ms timeout. 2. In ExecFileBoundedOutput, unchunked streams were concatenated before slicing with .subarray(-tailLimit), allowing unbounded memory growth on high-volume output before truncation. ## Change and scope 1. WindowsOwnedProcess: call this.#schedule(100) in the catch block when this.#closed is false. 2. ExecFileBoundedOutput: slice chunk to rest.subarray(-tailLimit) before buffer concatenation. Retains child exit code without terminating the process prematurely. ## Contract and boundary impact - Semantic owner: process - Contribution scope fit: bugfix - CLI and MCP/tool-catalog contract: none - Platform compatibility: Windows (x64) and POSIX ## Author readiness Human owner: @ZG0D-FF - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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
morluto/rea#6960
No description provided.