[PR #4216] [CLOSED] [Engine] Keep portable watcher identity stable across process state changes #4954

Closed
opened 2026-11-07 16:31:35 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4216
Author: @yuantianxiayouqingrenzhongchengxiongmei
Created: 10/26/2026
Status: ❌ Closed

Base: main ← Head: fix/lifeline-watcher-token


📝 Commits (1)

  • d168516 [Engine] Keep portable watcher identity stable across process state changes

📊 Changes

2 files changed (+76 additions, -2 deletions)

View changed files

📝 serve/lifeline.py (+5 -2)
➕ serve/test_watcher_token.py (+71 -0)

📄 Description

When a child changes from running to sleeping between launch and parent death, the portable watcher can leave it alive. Its identity token currently includes the mutable ps stat field, so the same process is mistaken for a reused PID. This matches the failure reported in #3407.

Compare only the start time in both the launcher and standalone watcher. Keep the state separate for zombie detection, including Zs and Z+. Add deterministic regressions for state transitions, localized start times, PID reuse, released children and zombies.

Fixes #3407.

Validation of d168516:

  • Linux: the existing Minimal serving runtime workflow passed, including fake-engine smoke and the full server suite. The public summary confirms success; exact per-test counts were not retrieved.
  • Windows / Python 3.11.1: python -X utf8 -m unittest serve.test_watcher_token serve.test_lifeline -q ran 13 tests: 11 passed, 2 POSIX/Linux cases skipped, with one unclosed-file ResourceWarning.
  • The 7 new deterministic regressions fail against the unmodified implementation and pass after the change. They execute the actual watcher code with simulated process observations and signals; the Linux workflow supplies real process coverage.
  • git diff --check origin/main...HEAD passed.

Not run: real macOS process validation. No native engine/backend code changes or performance claims.


🔄 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/4216 **Author:** [@yuantianxiayouqingrenzhongchengxiongmei](https://github.com/yuantianxiayouqingrenzhongchengxiongmei) **Created:** 10/26/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/lifeline-watcher-token` --- ### 📝 Commits (1) - [`d168516`](https://github.com/Niko1221/Strata/commit/d168516cc9806c9f994516d4b84a1eb1070940c5) [Engine] Keep portable watcher identity stable across process state changes ### 📊 Changes **2 files changed** (+76 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `serve/lifeline.py` (+5 -2) ➕ `serve/test_watcher_token.py` (+71 -0) </details> ### 📄 Description When a child changes from running to sleeping between launch and parent death, the portable watcher can leave it alive. Its identity token currently includes the mutable `ps stat` field, so the same process is mistaken for a reused PID. This matches the failure reported in #3407. Compare only the start time in both the launcher and standalone watcher. Keep the state separate for zombie detection, including `Zs` and `Z+`. Add deterministic regressions for state transitions, localized start times, PID reuse, released children and zombies. Fixes #3407. Validation of `d168516`: - Linux: the existing [Minimal serving runtime workflow passed](https://github.com/yuantianxiayouqingrenzhongchengxiongmei/Strata/actions/runs/40312779310), including fake-engine smoke and the full server suite. The public summary confirms success; exact per-test counts were not retrieved. - Windows / Python 3.11.1: `python -X utf8 -m unittest serve.test_watcher_token serve.test_lifeline -q` ran 13 tests: 11 passed, 2 POSIX/Linux cases skipped, with one unclosed-file ResourceWarning. - The 7 new deterministic regressions fail against the unmodified implementation and pass after the change. They execute the actual watcher code with simulated process observations and signals; the Linux workflow supplies real process coverage. - `git diff --check origin/main...HEAD` passed. Not run: real macOS process validation. No native engine/backend code changes or performance claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:31:35 +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#4954
No description provided.