Add OPcache restart hook, fired when a restart is carried out - #23828
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
zend_accel_schedule_restart_hook tells an observer that a restart of OPcache's shared memory is coming, but not whether or when it happens: the restart runs later, at request startup, on whichever thread or process first finds the cache unused, and it can stay pending for a long time. This adds zend_accel_restart_hook, called on that thread once per restart, right after the restart completed, with the same reason. A threaded SAPI needs it for its logs and metrics, since the restart rewinds shared memory that other threads may still reference.
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.
After #15590, which added
zend_accel_schedule_restart_hook.That hook says a restart of OPcache's shared memory is coming, not that it happened: the restart runs later, at request startup, on whichever thread or process first finds the cache unused, and it can stay pending for a long time. This adds
zend_accel_restart_hook, called on that thread once per restart, right after it completed and still under the SHM lock, with the same reason.FrankenPHP needs it for its logs and metrics: under ZTS the restart rewinds shared memory that other threads may still reference, so the exact moment matters for post-mortems, and the scheduling event alone doesn't tell an operator whether the restart ran at all.
This targets master, like #15590 did at the same point of the 8.4 cycle.