Skip to content

[Messenger] Making cache rebuild correctly when message subscribers change #31445

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

Conversation

weaverryan
Copy link
Member

Q A
Branch? 4.3
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #31409
License MIT
Doc PR not needed

An edge-case that's identical to EventSubscriberInterface: when the return value of getHandledMessages() changes, the container needs to be rebuilt.

If you're wondering why these checks aren't in their own resource class, see #25984 - it's something we probably should do, but haven't done yet.

@weaverryan weaverryan force-pushed the messenger-subscriber-cache-rebuild branch from 2355715 to d88446b Compare May 9, 2019 16:56
@weaverryan weaverryan changed the base branch from 4.3 to 4.2 May 9, 2019 16:56
class TestMessageSubscriberConfigHolder
{
public static $handledMessages = [];
}
Copy link
Member Author

Choose a reason for hiding this comment

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

I discovered that testEventSubscriber() and testServiceSubscriber() are invalid. Part of the signature of ReflectionClassResource is the constants and their values. So, to purely test that the resource becomes stale when a static method is called, we must do that without modifying any constants.

Those other 2 methods need to be fixed in 3.4 - you can comment out the code in ReflectionClassResource for each and they still pass.

@weaverryan weaverryan modified the milestones: 4.3, 4.2 May 9, 2019
@nicolas-grekas
Copy link
Member

Good catch, thanks @weaverryan.

@nicolas-grekas nicolas-grekas merged commit d88446b into symfony:4.2 May 11, 2019
nicolas-grekas added a commit that referenced this pull request May 11, 2019
…bscribers change (weaverryan)

This PR was merged into the 4.2 branch.

Discussion
----------

[Messenger] Making cache rebuild correctly when message subscribers change

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

An edge-case that's identical to `EventSubscriberInterface`: when the return value of `getHandledMessages()` changes, the container needs to be rebuilt.

If you're wondering why these checks aren't in their own resource class, see #25984 - it's something we probably should do, but haven't done yet.

Commits
-------

d88446b Making cache rebuild correctly with MessageSubscriberInterface return values
This was referenced May 22, 2019
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