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

[DependencyInjection] DoctrineBundle 1.6.2 upgrade to 1.6.4 throw circular reference error with multi lazy services. #19901

Copy link
Copy link
Closed
@antanas-arvasevicius

Description

@antanas-arvasevicius
Issue body actions

Hello,
DoctrineBundle have made a change ir orm.xml (added lazy=true):

 <service id="doctrine.orm.entity_manager.abstract" class="%doctrine.orm.entity_manager.class%" abstract="true" lazy="true" />

Now all my lazy services which are actually doctrine listeners stopped working (throws circular error).

After couple of hours of debugging I've found out a bug (hopefully) in PhpDumper.php hasReference method.

I've added a debugging echo lines in that method and saw these results:

hasReference: (doctrine.dbal.default_connection) , visited: doctrine.orm.default_listeners.attach_entity_listeners -> listener.event_logger -> doctrine.orm.default_entity_manager -> doctrine.orm.default_entity_manager.delegate (eq: false)
Service: doctrine.orm.default_entity_manager.delegate (lazy), has arguments: [ doctrine.dbal.default_connection, def: Doctrine\ORM\Configuration  ]
hasReference: (doctrine.dbal.default_connection) , visited: doctrine.orm.default_listeners.attach_entity_listeners -> listener.event_logger -> doctrine.orm.default_entity_manager -> doctrine.orm.default_entity_manager.delegate -> doctrine.dbal.default_connection (eq: true)

It looks like hasReference also recursively looking up a lazy services arguments for reference search,
I've thought, is that really logically? Because lazy services is lazy and are instantiated indirectly so more logically would be skip reference search in lazy service definitions, isn't it?

more information:
doctrine/DoctrineBundle#559 (comment)

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.