-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Extend pcntl_waitid with rusage parameter #15921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
729ced4
to
ed5fcbd
Compare
IMHO, I would not worry that much about it. This PR qualifies more for the next major release. Ideally, the existing PR doc should be merged during the 8.4 doc rollercoaster. Merging this PR later and adding relevant infos in the doc. |
9c27dde
to
2254c05
Compare
That's fine, as this extension is fully backwards compatible with existing code.
Cool, all comments in that doc PR have been addressed and it's ready for another round of review. |
The FreeBSD test pass for me locally otherwise. |
They pass for me locally as well. Is there an easy way to see test logs from the Cirrus CI run? |
Changed unit test code to synchronize parent and child on every step. |
f515815
to
6166f2c
Compare
Found a rare race condition in the unit test, where the child could receive a signal just after signal_dispatch, but just before sleep, in which case the signal would would not interrupt the sleep, and the test would take a long time to complete. Most direct solution I could think of was replacing this code with a quick (starting at 100 ns) exponential backoff loop, so that the race condtion is neutralized, but the unit test should still complete in milliseconds. @devnexen are you able to run that FreeBSD CI workflow again? |
Yes the test works for me locally. |
@devnexen Okay, great. I also had a colleague test it on macOS, macOS provides (undocumented) POSIX-compatible waitid, but doesn't support I self-reviewed one more time, and it looks good to go, but let's let others take a look as well. //cc @bukka @kocsismate |
This functionality is not part of the POSIX interface. - On FreeBSD, the wait6 system call provides it - On Linux, the raw waitid system call provides it (glibc does not)
I will take a proper look later. It's too late for PHP 8.4 so this should wait after branching it out anyway. |
Enhancement to #14616.
This functionality is not part of the POSIX waitid interface.
wait6
system call provides itwaitid
system call provides it, but it is not part of the interface exposed by glibc.Conceptually, this is similar to how
pcntl_wait
andpcntl_waitpid
extend the POSIX interface to fetch rusage info, where supported by the host OS.Requesting code review @devnexen @bukka @petk @kocsismate @Girgias
Documentation PR for pcntl_waitid is not merged yet, I can add to that open PR, or document this in a separate one, depending on what PR we merge first.
[edit] Created a documentation PR.