Repository navigation
Dispatch async signals during time_sleep_until() - #24400
Open
nicolas-grekas wants to merge 1 commit into
Open
nicolas-grekas wants to merge 1 commit into
nicolas-grekas wants to merge 1 commit into
Conversation
nicolas-grekas
force-pushed
the
time-sleep-until-async-signals
branch
from
November 12, 2026 17:24
5455d2c to
3a54a79
Compare
Contributor
Author
|
Rebased. #24399 already merged the part that resumes the sleep, so this PR is now 6 lines plus tests. I added a test for the sleep resuming after a handler returns, and I updated the description. @arnaud-lb WDYT of this as a first step before #22538 reaches the other EINTR loops? There's one difference with #22538. Here the sleep always resumes when the handler returns, whatever |
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.
Related to bug #38480 and to #22538.
With
pcntl_async_signals(true), signal handlers now run whiletime_sleep_until()waits. A handler can throw or exit before the deadline. If the handler returns, the sleep resumes until the original deadline.#24399 already made the sleep resume with the remaining time. This PR adds the missing part. When
nanosleep()is interrupted,time_sleep_until()now callszend_fcall_interrupt(), like the VM does after an internal function returns. As a consequence,max_execution_timecan also stop the sleep when its timer interruptsnanosleep().A signal that arrives while another handler is running still waits for the deadline, because pcntl blocks signals during a handler.