Skip to content

[FrameworkBundle] Fix using "annotations.cached_reader" in after-removing passes #25696

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

Merged
merged 1 commit into from
Jan 8, 2018

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 3.3
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #25695
License MIT
Doc PR -

When annotation_reader is instantiated in an after-removing pass, it gets the real cache provider, instead of the dummy one that should be provided during compilation of the container.

This situation is found in e.g. JMS\AopBundle\DependencyInjection\Compiler\PointcutMatchingPass.

A workaround before next release could be to "get" the annotation_reader service somewhere before (like in a regular compiler pass of your own.)

@fabpot
Copy link
Member

fabpot commented Jan 8, 2018

Thank you @nicolas-grekas.

@fabpot fabpot merged commit f66f9a7 into symfony:3.3 Jan 8, 2018
fabpot added a commit that referenced this pull request Jan 8, 2018
… after-removing passes (nicolas-grekas)

This PR was merged into the 3.3 branch.

Discussion
----------

[FrameworkBundle] Fix using "annotations.cached_reader" in after-removing passes

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #25695
| License       | MIT
| Doc PR        | -

When `annotation_reader` is instantiated in an after-removing pass, it gets the real cache provider, instead of the dummy one that should be provided during compilation of the container.

This situation is found in e.g. `JMS\AopBundle\DependencyInjection\Compiler\PointcutMatchingPass`.

A workaround before next release could be to "get" the `annotation_reader` service somewhere before (like in a regular compiler pass of your own.)

Commits
-------

f66f9a7 [FrameworkBundle] Fix using "annotations.cached_reader" in after-removing passes
@nicolas-grekas nicolas-grekas deleted the later-cached-annot branch January 9, 2018 11:00
This was referenced Jan 29, 2018
nicolas-grekas added a commit that referenced this pull request Feb 10, 2021
…he "container.hot_path" (nicolas-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] fix registering "annotations.cache" on the "container.hot_path"

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

Because `annotations.cache` is registered in a quite special way (see #25696), `ResolveHotPathPass` cannot propagate the `container.hot_path` tag to it.

Let's add the tag explicitly since this service is always on the hot path anyway.

Spotted with Blackfire.io as usual.

Commits
-------

e196c1e [FrameworkBundle] fix registering "annotations.cache" on the "container.hot_path"
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.

3 participants