Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Cache] Prevent fatal errors on php 8 when running concurrently with TagAwareAdapter v6.1#46143
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
84a0b75 to22c3afdCompare| if (isset($invalidatedTags[$tag])) { | ||
| $invalidatedTags[$tag] =$version->set(++$tagVersions[$tag]); | ||
| } | ||
| if (!\is_int($tagVersions[$tag])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
on the line above, we have a++ on this entry, shouldn't we check for this earlier?
sbelyshkinApr 22, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
++ operator works with strings
Although it not always changes string values (and thus no invalidation occurs in those cases) but at least it doesn't do the fatality.
xabbuh commentedApr 22, 2022
Can we add a test to prevent future regressions? |
22c3afd to0f085c4Comparesbelyshkin commentedApr 22, 2022
I've added a few tests. Please let me know if they make sense. |
0f085c4 to33790b3Compare…TagAwareAdapter v6.1
33790b3 to33f8496Comparenicolas-grekas commentedApr 25, 2022
Thank you@sbelyshkin. |
This fix prevents fatal errors which may arise during rolling updates when TagAwareAdapter is upgraded from versions prior to 5.4 to the latest 6.1. TypeErrors occur because of different value types for tag versions and rules for numeric strings in php 8.xhttps://www.php.net/manual/en/language.types.numeric-strings.php