Conversation
Model spawn pipe endpoints by the operations workers use, isolate POSIX-only lifecycle assertions, and add Windows type-check and worker cleanup coverage. Fixes oceanbase#1658
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue or RFC does this PR close?
Closes #1658.
Rationale for this change
Windows spawn pipes are represented as
PipeConnection, while the worker lifecycle annotated them as POSIXConnectionobjects. The lifecycle tests also depended on POSIX-only process APIs and spawn internals, causing seven Windows-target type-checking errors and preventing the cleanup behavior from being exercised on Windows.Related work and acknowledgement
Thanks to @knqiufan for sharing the overlapping draft implementation in #1676 and closing it in favor of the existing community contribution.
I reviewed that draft as an optional reference. This PR uses capability-based pipe protocols and platform-specific spawn seams so the existing cleanup tests can run on Windows instead of being skipped. It also incorporates the focused Windows CI structure and retains coverage for cancellation after a child has been published.
What changes are included in this PR?
Popen._launchon POSIX andPopen.__init__on Windows.ERROR_INVALID_PARAMETERas evidence that a Windows PID no longer exists; propagate otherOpenProcessfailures.Are there any user-facing changes?
No public API, schema, dependency, configuration, or persisted-format changes.
The change improves Windows type safety and validates worker cleanup behavior without changing the worker lifecycle contract.
How was this change tested?
uv run --locked --no-sync ty check --python-platform win32 src/powercontext/builtin/runtime/artifact_processing.py tests/builtin/runtime/test_artifact_processing.pyuv run --locked --no-sync ty check --python-platform linux src/powercontext/builtin/runtime/artifact_processing.py tests/builtin/runtime/test_artifact_processing.py7 passedThe repository-wide Windows type check also reports three pre-existing
url2pathnamedeprecation warnings that #1658 explicitly identifies as out of scope. The focused Windows check added by this PR passes without ignores or warning suppression.AI usage statement
OpenAI Codex (GPT-5) was used to inspect the issue and review feedback, implement the fixes, design regression tests, and review the final change.