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

Appearance settings

[FrameworkBundle] CachePoolClearerPass fails if "cache.annotations" service is created #21339

Copy link
Copy link
Closed
@antanas-arvasevicius

Description

@antanas-arvasevicius
Issue body actions
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3.0-dev

Using Symfony 3.3.0-dev + "jms/di-extra-bundle": "dev-master" got an error:

[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
You have requested a non-existent service "cache.annotations".

Problem is that DiExtraBundle AnnotationConfigurationPass is using annotation reader service which uses "cache.annotations" and they are instantiated in AnnotationConfigurationPass.
After that "cache.annotations" definition no longer available as it's already instantiated.
Now CachePoolClearerPass uses has('cache.annotations') and then getDefinition('cache.annotations') (see: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolClearerPass.php#L55 )
has('cache.annotations') returns true, because it has that service, but getDefinition() now throws exception because no definition exists.

DiExtraBundle is registering AnnotationConfigurationPass in before optimization pass and FrameworkBundle's CachePoolClearerPass is registered in after removing pass.
Maybe we could rearrange these Passes, or it would be safe to patch CachePoolClearerPass to use not has() but hasDefinition() instead? In this case, users who uses DiExtra bundle won't get 'monolog.logger.cache' inserted into 'cache.annotations' so don't know is this also good option.

What's your thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.