Rewrite the process monitor - #5770
Open
SeanTAllen wants to merge 1 commit into
Open
Conversation
redvers
force-pushed
the
main
branch
2 times, most recently
from
July 16, 2026 01:27
9418f11 to
7846a39
Compare
SeanTAllen
marked this pull request as ready for review
July 16, 2026 11:12
SeanTAllen
force-pushed
the
redesign-process-monitor-exit-detection
branch
from
July 22, 2026 02:02
400d5d9 to
eb5df83
Compare
SeanTAllen
force-pushed
the
redesign-process-monitor-exit-detection
branch
3 times, most recently
from
July 23, 2026 01:42
f5e539f to
5aa5547
Compare
SeanTAllen
force-pushed
the
redesign-process-monitor-exit-detection
branch
2 times, most recently
from
August 12, 2026 17:21
ae1d683 to
f3b9808
Compare
SeanTAllen
added a commit
that referenced
this pull request
Aug 12, 2026
The rebase put #5770's entries into 0.68.0 instead of unreleased and left an empty ### Added heading that broke changelog-tool verify.
SeanTAllen
force-pushed
the
redesign-process-monitor-exit-detection
branch
from
August 12, 2026 21:32
177aa93 to
71f835c
Compare
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.
Detect a child's exit from a native OS event instead of waiting for its output
pipes to close. Construction becomes a
StartProcessfactory that returns alive
ProcessMonitoror aProcessError. This is the redesign worked out indiscussion #5769.
ProcessMonitorused "stdout and stderr both reached end-of-file" as thesignal that the child had exited. But a pipe reaches end-of-file only when
every process holding its write end has closed it, and the child is not always
the last one holding it: a grandchild that inherited stdout or stderr, or the
parent still holding the child's stdin, keeps the pipe open after the child is
gone. So
ProcessMonitorreported the exit late, or not at all. That one wrongassumption caused both #5764 and #5748.
Now the child's exit arrives as an OS event — a pidfd on Linux,
EVFILT_PROCon kqueue, and a waitable process handle on Windows — and that event is the
only signal that the child has exited. A pipe reaching end-of-file is now just
a reason to stop reading that pipe. Two related bugs go with the change: the
kill-after-reap guard is now structural (#5765), and a start that fails no
longer leaks its pipes (#5766).
Closes #5764, #5748, #5765, #5766. Design: #5769.
What changed for callers
Starting a process now returns a result. Where you wrote:
you now write:
Failures that used to arrive asynchronously through
ProcessNotify.failed— noexecute permission, a missing executable, and now a Linux kernel too old for
pidfd_open— are returned synchronously byStartProcess, and no monitor iscreated for them. The
ExecveErrorthat meant two things (a missing file, andexecvefailing in the child) is split: the missing-file precondition is nowExecutableNotFound.