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

[Cache][Messenger] fixed CallbackInterface support in async expiration handler #49422

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

Conversation

AdamKatzDev
Copy link
Contributor

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

Adds support for CallbackInterface in EarlyExpirationHandler and thus fixes async cache recomputing for callables that implement CallbackInterface. Earlier similar errors were fixed in #31879.

@carsonbot carsonbot added this to the 5.4 milestone Feb 17, 2023
@carsonbot carsonbot changed the title [Messenger][Cache] fixed CallbackInterface support in async expiration handler [Cache][Messenger] fixed CallbackInterface support in async expiration handler Feb 17, 2023
@@ -73,7 +73,8 @@ function (CacheItem $item, float $startTime) {
$startTime = microtime(true);
$pool = $message->findPool($this->reverseContainer);
$callback = $message->findCallback($this->reverseContainer);
$value = $callback($item);
$save = true;
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this implement the handling of this $save flag ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My guess is at this point this is not needed since it was specifically asked to recalculate the cache item asynchronously.
There could be some use cases that I miss though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does look like I am doing something wrong here. But I am also guessing if handling $save will make things worse for someone.

Copy link
Member

Choose a reason for hiding this comment

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

@nicolas-grekas can you give your opinion on this ?

Copy link
Member

Choose a reason for hiding this comment

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

My guess is at this point this is not needed since it was specifically asked to recalculate the cache item asynchronously.

Correct!

@nicolas-grekas
Copy link
Member

Thank you @AdamKatzDev.

@nicolas-grekas nicolas-grekas merged commit e9bd2ab into symfony:5.4 Feb 21, 2023
This was referenced Feb 28, 2023
@AdamKatzDev AdamKatzDev deleted the fix/async_expiration_handler_callback_interface_support branch March 2, 2023 18:36
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.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.