fix: keep dumped container cache correct across relocation, upgrades and inline classes (fixes #690) - #691
Merged
Merged
Conversation
A dumped container keeps the absolute cache directory of the machine that built it, so a deployment warming the cache on one host and running the artifact from another path fails as soon as a gateway proxy is generated lazily. Loading a cached container now supplies the runtime cache configuration to it, overriding the instance baked into the dump. Fixes #690
An anonymous class is named after its file and a counter that changes between processes, so a dumped container referencing one can never be resolved again and a later bootstrap is served another bootstrap's container. Configurations registering an anonymous class are now rebuilt rather than cached. This is silent because caching is an optimisation, and raising here would break suites passing useCachedVersion alongside inline handlers.
The lock file never reached the cache key: its path was concatenated without a separator, so the file was never found and upgrading dependencies reused the previous container. The key also recorded which files a configuration registered rather than which classes, so two configurations declared in the same file shared one cache entry.
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.
Why is this change proposed?
Description of Changes
useCachedVersion: truealongside inline handlers.Verified: Ecotone 1318 tests green, PHPStan clean, php-cs-fixer clean, Symfony/Laravel/Tempest suites green.
Pull Request Contribution Terms