Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.

Fixes #23859
i looked into the map pointer growth after repeated
opcache_reset()calls and found that surviving FPM workers could keep an outdatedCG(map_ptr_last)value after a restartwhen those workers cached new scripts the old watermark would get published back into shared memory causing the map pointer table to keep growing after each reset
the fix resets the local watermark during activation while keeping startup and preloaded slots intact
i also added an FPM regression test using two separate workers to make sure the map pointer count stays stable when another worker triggers a reset
the test fails on the original code and passes with the fix, i also ran it 20 times without any failures
after 24 reset cycles the original version went from 933 to over 18000 map pointer slots while the patched version stayed at 933
NTS and ZTS both passed 6031 tests with no failures and i also checked concurrent FPM requests, worker replacement, preloading, JIT and ASan
LeakSanitizer still reported some allocations during worker shutdown but the same ones also appeared on unchanged builds so nothing new seems to have been introduced
i haven't tested Windows, 32 bit platforms or threaded web SAPIs