Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DependencyInjection] Fix circular detection with multiple paths #39058

Merged
merged 1 commit into from Nov 12, 2020

Conversation

jderusse
Copy link
Member

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #39056
License MIT
Doc PR -

There are currently 2 kind of issues related to the Dependency Injection:

  1. performance issue when project contains many loops (Injecting certain services causes O(n) compilation complexity, while injecting Container is O(1) #37850)
    Which has been fixed by [DependencyInjection] fix performances in circular refs detection #38882

  2. Infinity loop in some case (Maximum function nesting level of '256' reached with retryable http client and mailer handler #38970)
    Which has been fixed by [DependencyInjection] Fix circular reference with Factory + Lazy Iterrator #38980 and [DependencyInjection] Optimize circular collection by removing flattening #39021

The new issue #39056 has been introduced by #38882 (The performance issue refactor) because in order to optimize loop detection, I take a short cut and choose to not collect ALL the circular loop but only the one that matters

I was wrong. All loops matters.

This PR fix my previous refacto to collect ALL the paths, with a low CPU footprint

Copy link
Member

@chalasr chalasr left a comment

Choose a reason for hiding this comment

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

Does fix the segfault on my side. Thanks!

@PhilETaylor
Copy link
Contributor

I have tested this against my reproducer in #39056 and Im pleased to report it fixes the reported issue.

@derrabus
Copy link
Member

Thanks Jérémy.

@derrabus derrabus merged commit faead95 into symfony:4.4 Nov 12, 2020
@fabpot fabpot mentioned this pull request Nov 21, 2020
This was referenced Nov 29, 2020
@jderusse jderusse deleted the fix-circular branch December 9, 2020 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants