Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Remove randomness from dumped containers#25671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
cb7046b to23cb152Compare| $version = (newDefinition(\ReflectionClass::class))->addArgument(newReference('service_container')); | ||
| $version = (newDefinition())->setFactory(array($version,'getFileName')); | ||
| $version = (newDefinition())->setFactory('implode')->addArgument(array( | ||
| (newDefinition())->setFactory('filemtime')->addArgument($version), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
hum actually this incurs unwanted IO, I need to look for something else
b8553e3 tobd4161fComparenicolas-grekas commentedJan 4, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
PR ready (fabbot failure is false positive.) |
bd4161f to7186d0eComparenicolas-grekas commentedJan 4, 2018
(failure caused by bug in Composer, seecomposer/composer#6973) |
sroze commentedJan 4, 2018
Could be retried now with the new release then :) |
nicolas-grekas commentedJan 4, 2018
PR green (deps=high failure will be fixed by merging to upper branches) |
| "symfony/cache":"~3.4|~4.0", | ||
| "symfony/class-loader":"~3.2", | ||
| "symfony/dependency-injection":"~3.4|~4.0", | ||
| "symfony/dependency-injection":"~3.4.3|~4.0.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Shoudn't it be^3.4.3|^4.0.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
oups, fixed
7186d0e to14dd5d1Comparefabpot commentedJan 4, 2018
Thank you@nicolas-grekas. |
1 similar comment
fabpot commentedJan 4, 2018
Thank you@nicolas-grekas. |
This PR was merged into the 3.4 branch.Discussion----------Remove randomness from dumped containers| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -With this PR, the generated container is immutable by cache clearing: it doesn't contain any random string anymore (well, third party bundles can add random things back, but at least core doesn't).Since the class+file name of the container is based on a hash of its content, it means that they are now stable also. This should help fix some edge cases/race conditions during cache clears/rebuilds.(fabbot failure is false positive)Commits-------14dd5d1 Remove randomness from dumped containers
mcnilz commentedJan 5, 2018
After updating to symfony 3.4.3 I get the following error: |
nicolas-grekas commentedJan 5, 2018
@mcnilz can you share a reproducer please? does this happen if you clear the cache manually? |
mcnilz commentedJan 5, 2018
@nicolas-grekas yes on cache:clear and each request. |
nicolas-grekas commentedJan 5, 2018
A service is used at compile time... Can you share the full stack trace please? |
mcnilz commentedJan 5, 2018
maybe the JMS stuff |
mcnilz commentedJan 5, 2018
Yes. If I disable JMSSecurityExtraBundle (just for testing) it works again. |
nicolas-grekas commentedJan 5, 2018
ok, I can reproduce it. |
Tobion commentedJan 21, 2018
@nicolas-grekas the proxy-manager uses deterministic proxy properties sinceOcramius/ProxyManager#385 but the proxy class name is still random between cache clears. This is becausehttps://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php#L105 uses |
Uh oh!
There was an error while loading.Please reload this page.
With this PR, the generated container is immutable by cache clearing: it doesn't contain any random string anymore (well, third party bundles can add random things back, but at least core doesn't).
Since the class+file name of the container is based on a hash of its content, it means that they are now stable also. This should help fix some edge cases/race conditions during cache clears/rebuilds.
(fabbot failure is false positive)