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

[DependencyInjection] Adding an exception on circular reference#28452

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

Closed
nicoweb wants to merge1 commit intosymfony:3.4fromnicoweb:fix_issue_28312

Conversation

@nicoweb
Copy link
Contributor

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

When aChildDefinition references itself as parent (or as ancestor in case of longer cycle), an infinite loop happens in the resolution logic.

It's a try to fix this "bug", thank's for your feedback...

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

Thank you for working on this!
Here are some comments to help move forward.

thrownewBadMethodCallException('Adding definition to a compiled container is not allowed');
}

if ($definitioninstanceof ChildDefinition &&$id ===$definition->getParent()) {

Choose a reason for hiding this comment

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

I would suggest moving the logic toResolveChildDefinitionsPass.
Also, can't the loop involve intermediary ids? A => B => C => A?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks for your feedback.
I can move it toResolveInstanceofConditionalsPass (here), but I think it's not a good option too...
Currently I can't find the way to move it toResolveChildDefinitionsPass. If you have an idea...

*
* @author Nicolas LEFEVRE <weblefevre@gmail.com>
*/
class ArgumentCircularReferenceExceptionextends RuntimeException

Choose a reason for hiding this comment

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

if we want this to make it into a bug fix release, we should not add any new class in the PR (otherwise that'd be a smell for a new feature).
Instead, what about throwing a ServiceCircularReferenceException?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

OK, throwingServiceCircularReferenceException should be a good idea...

@nicolas-grekas
Copy link
Member

Closing in favor of#28480, which is closer to the final patch.
Thank you for working on this and sorry for the collision, that usually doesn't happen...

@nicowebnicoweb deleted the fix_issue_28312 branchSeptember 18, 2018 02:16
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

3 participants

@nicoweb@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp