Repository navigation
Conversation
CPython 3.14.10 (gh-158287) makes asyncio's child watcher on macOS take a stopped child's wait report with waitid(WSTOPPED | WNOHANG). The stop watcher waited for that same report with WNOWAIT, so when asyncio's thread got there first the watcher never woke, and the call ran out its timeout instead of reporting a crash. On macOS the watcher now polls proc_pidinfo() for the worker's state, which shows SSTOP regardless of who took the report. This also covers macOS before Python 3.13, which has no os.waitid, so the driver test now runs there too. Other platforms keep the waitid wait.
The stop watcher took the worker's start time on its first poll, so a worker reaped before the thread first ran could be confused with a later process that reused its PID. LocalSession now reads it on the event loop's thread right after the spawn, before asyncio can reap the worker.
Contributor
|
Preview root: https://posit-dev.github.io/commons/pr-460/ Python site preview: https://posit-dev.github.io/commons/pr-460/py/ Built from the latest commit on this branch. The R links in it point at the published R site, which no pull request rebuilds. |
pyrefly evaluates sys.platform checks for the platform it runs on, so on Linux the early return left the rest of _process_start typed as unreachable. The caller now decides whether to read it.
This branch has not been deployed
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.
This PR makes the stop watcher read a macOS worker's state from the process table, so a worker that stops itself is still killed at once on Python 3.14.10. In that release, asyncio takes the stopped child's wait report itself (python/cpython#158287), so the watcher never woke and the call waited out its timeout. This is the
check (macos-latest, 3.14)failure on posit-dev/commons#443.Agent-written detail
20261026) has CPython 3.14.10. I reproduced the failure on 3.14.8 by patching in 3.14.10's child-watcher change. Before this fix the test failed 1 run in 3. After it, 20 of 20 runs passed.os.waitid. There, a stopped worker used to fail at the call timeout. With this fix it is killed at once, so the driver test now runs on those versions too. Linux keeps thewaitidwait.