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][FrameworkBundle] Fix logging for TagAwareAdapter#40740
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
fancyweb commentedApr 8, 2021
| Q | A |
|---|---|
| Branch? | 4.4 |
| Bug fix? | yes |
| New feature? | no |
| Deprecations? | no |
| Tickets | #40108 |
| License | MIT |
| Doc PR | - |
cccd9d1 to22de60aComparefancyweb commentedApr 8, 2021
Do we want to bump the required minimum symfony/cache version in FWB for this or add a runtime check? |
carsonbot commentedApr 9, 2021
Hey! I think@v-m-i has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
v-m-i left a comment
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.
Hi@fancyweb, thank you for this PR.
Kudos for detailed and readable tests.
I have added one typo-fix suggestion. Everything else looks good :)
Besides code, I see that some builds have failed so I would suggest looking into that.
src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas left a comment
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.
(once the typo is fixed)
c08849f tobeb338bComparebeb338b to6b0becaCompare| publicstaticfunctioncompute(callable$callback,ItemInterface$item,bool &$save,CacheInterface$pool,\Closure$setMetadata =null,LoggerInterface$logger =null) | ||
| { | ||
| $key =self::$files ?crc32($item->getKey()) %\count(self::$files) : -1; | ||
| $key =self::$files ?abs(crc32($item->getKey())) %\count(self::$files) : -1; |
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.
Because PHP's integer type is signed many crc32 checksums will result in negative integers on 32bit platforms.
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.
I find it better to usesprintf('%u')
fancyweb commentedApr 11, 2021
Tests are green 🎉 |
nicolas-grekas commentedApr 11, 2021
Thank you@fancyweb. |
…yweb)This PR was merged into the 4.4 branch.Discussion----------[FrameworkBundle] Fix log channel of TagAwareAdapter| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -Forgot to add the tag in#40740, therefore the "app" logger is injected instead of the "cache" one.Commits-------494ceaf [FrameworkBundle] Fix log channel of TagAwareAdapter
…yweb)This PR was merged into the 4.4 branch.Discussion----------[FrameworkBundle] Fix log channel of TagAwareAdapter| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -Forgot to add the tag insymfony/symfony#40740, therefore the "app" logger is injected instead of the "cache" one.Commits-------494ceaf6cc [FrameworkBundle] Fix log channel of TagAwareAdapter