(dev/core#4055) ClassLoader - Use separate cache IDs for different configurations of modules #25379
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.
Overview
Possible alternative to #25235. It aims to address https://lab.civicrm.org/dev/core/-/issues/4055, although I don't know that my local system is suitable for testing.
Before
When you enable or disable an extension:
CachedExtLoader.{$envId}.php
, thenCachedExtLoader.{$envId}.php
, and finallyCachedExtLoader.{$envId}.php
.But in some environments, step (3) is reported to read stale data because the opcode cache has momentarily retained the old data.
After
When you enable or disable an extension, it changes the
{$envId}
used for the filenameCachedExtLoader.{$envId}.php
.Since the
{$envId}
is different, it doesn't matter whether the opcode cache retains the old data -- because it's retained under the old name. The new name should be clean.Comments
I haven't specifically tried to reproduce the scenario in 4055. Putting this up to see if the test-suite likes it.
ping @kainuk