Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[FrameworkBundle] Don't rely on any parent definition for "cache.annotations"#20601

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

Merged
fabpot merged 1 commit intosymfony:3.2fromnicolas-grekas:cache-system
Nov 26, 2016

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedNov 23, 2016
edited
Loading

QA
Branch?3.2
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

Instead of a generic approach that failed in#20537, let's focus on thecache.annotations service, which is the one that needs special care because it can be required while the container is being built. See e.g.:

When the service is required at build time, we can't provide it a logger, because no logger service is ready at that time. Still, that doesn't prevent the service from working. The lateCachePoolClearerPass wires the logger for later instantiations so thatcache.annotations has a properly configured loggerfor the next requests.


if ($container->getParameter('kernel.debug')) {
$container->addCompilerPass(newAddDebugLogProcessorPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -1);
$container->addCompilerPass(newAddDebugLogProcessorPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -32);
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

changing to 32 to leave room for a bit of extensibility

@nicolas-grekasnicolas-grekas added this to the3.2 milestoneNov 23, 2016
@nicolas-grekas
Copy link
MemberAuthor

nicolas-grekas commentedNov 24, 2016
edited
Loading

ping@stof for validation/approval please

$annotationsPool->addArgument(newReference('monolog.logger.cache'));
}elseif ($container->has('cache.system')) {
$systemPool =$container->getDefinition('cache.system');
if ($factory ===$systemPool->getFactory() &&5 ===count($systemArgs =$systemPool->getArguments())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

wouldn't it be more future-proof to use5 <= ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

updated

@nicolas-grekas
Copy link
MemberAuthor

Ping @symfony/deciders , we need to make a decision on this one before the end of the week for 3.2 to be ready (3/3).

@nicolas-grekas
Copy link
MemberAuthor

Last issue on the 3.2 milestone!@stof any comment?

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commitf62b820 intosymfony:3.2Nov 26, 2016
fabpot added a commit that referenced this pull requestNov 26, 2016
…"cache.annotations" (nicolas-grekas)This PR was merged into the 3.2 branch.Discussion----------[FrameworkBundle] Don't rely on any parent definition for "cache.annotations"| Q             | A| ------------- | ---| Branch?       | 3.2| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -Instead of a generic approach that failed in#20537, let's focus on the `cache.annotations` service, which is the one that needs special care because it can be required while the container is being built. See e.g.:-#20234-http://stackoverflow.com/questions/39625863/vichuploadbundle-inb-symfony-3-cant-load-cache-annotations-service/40626277-schmittjoh/JMSDiExtraBundle#262When the service is required at build time, we can't provide it a logger, because no logger service is ready at that time. Still, that doesn't prevent the service from working. The late `CachePoolClearerPass` wires the logger for later instantiations so that `cache.annotations` has a properly configured logger *for the next requests*.Commits-------f62b820 [FrameworkBundle] Dont rely on any parent definition for "cache.annotations"
@nicolas-grekasnicolas-grekas deleted the cache-system branchNovember 26, 2016 21:24
@fabpotfabpot mentioned this pull requestNov 27, 2016
@xabbuh
Copy link
Member

@nicolas-grekas So does this mean that whether or not thecache.annotations service will have a logger injected will depend on which bundles I use and what they do inside their compiler passes?

@nicolas-grekas
Copy link
MemberAuthor

cache.annotations will always have a logger, but only after the container is loaded from its dumped version. Which means always if you do offline cache warmup, and not for the very first request otherwise.

fabpot added a commit that referenced this pull requestJan 24, 2017
…fore removing passes (nicolas-grekas)This PR was merged into the 3.2 branch.Discussion----------[FrameworkBundle] Dont wire "annotations.cached_reader" before removing passes| Q             | A| ------------- | ---| Branch?       | 3.2| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#21339| License       | MIT| Doc PR        | -This PR basically reverts#20601 and wires "annotations.cached_reader" later, so that any compiler passes needing "annotation_reader" at compile time don't get any cache - anyway, it's useless at compile time.Commits-------e59f0e0 [FrameworkBundle] Dont wire "annotations.cached_reader" before removing passes
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

Assignees

No one assigned

Projects

None yet

Milestone

3.2

Development

Successfully merging this pull request may close these issues.

5 participants

@nicolas-grekas@fabpot@xabbuh@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp