Skip to content

Conversation

@alexander-schranz
Copy link
Contributor

@alexander-schranz alexander-schranz commented Apr 15, 2020

Q A
Branch? 4.4
Bug fix? yes/no
New feature? no
Deprecations? no
Tickets Fix #36458
License MIT
Doc PR symfony/symfony-docs#...

It seems like a tag cacheItem is never a hit again. Not sure how fix this but the cache component is really hard to debug 🙈 .

It need to be somewhere generally as all TagAware caches are effected:

1) Symfony\Component\Cache\Tests\Adapter\FilesystemTagAwareAdapterTest::testRefreshAfterExpires

Failed asserting that false is true.

/home/travis/build/symfony/symfony/src/Symfony/Component/Cache/Tests/Traits/TagAwareTestTrait.php:194

2) Symfony\Component\Cache\Tests\Adapter\PredisTagAwareClusterAdapterTest::testRefreshAfterExpires

Failed asserting that true is false.

/home/travis/build/symfony/symfony/src/Symfony/Component/Cache/Tests/Traits/TagAwareTestTrait.php:183

3) Symfony\Component\Cache\Tests\Adapter\RedisTagAwareAdapterTest::testRefreshAfterExpires

Failed asserting that true is false.

/home/travis/build/symfony/symfony/src/Symfony/Component/Cache/Tests/Traits/TagAwareTestTrait.php:183

4) Symfony\Component\Cache\Tests\Adapter\RedisTagAwareClusterAdapterTest::testRefreshAfterExpires

Failed asserting that true is false.

/home/travis/build/symfony/symfony/src/Symfony/Component/Cache/Tests/Traits/TagAwareTestTrait.php:183

@nicolas-grekas
Copy link
Member

Did you try with 3.4?

@alexander-schranz
Copy link
Contributor Author

alexander-schranz commented Apr 15, 2020

@nicolas-grekas the bug only appears with the classes which extend from AbstractTagAwareAdapter like FilesystemTagAwareAdapter which do not exist in 3.4 only in 4.3 . The new TagAwareAdapter(new FileSystemAdapter)); which exist before does not contain this behaviour.

@alexander-schranz alexander-schranz changed the title [Cache] CacheItem with tag is never a hit after expired [Cache] [Reproducer] CacheItem with tag is never a hit after expired Apr 16, 2020
@nicolas-grekas nicolas-grekas added this to the 4.4 milestone Apr 18, 2020
@nicolas-grekas nicolas-grekas marked this pull request as ready for review April 18, 2020 14:29
@nicolas-grekas nicolas-grekas force-pushed the bugfix/filesystem-tag-aware-adapter-test branch from f8a8eb1 to d082eca Compare April 18, 2020 14:29
@nicolas-grekas
Copy link
Member

I pushed the fix on your fork. Redis adapters don't have the bug. The transient failures related to them are due to expirations being time-sensitive.
FilesystemTagAwareAdapter is the one that needed a fix.

@chalasr chalasr changed the title [Cache] [Reproducer] CacheItem with tag is never a hit after expired [Cache] CacheItem with tag is never a hit after expired Apr 18, 2020
@alexander-schranz
Copy link
Contributor Author

@nicolas-grekas looks good. Thank you for having a look at this 👍. Travis error seems to have nothing todo with the changes in this PR.

@nicolas-grekas
Copy link
Member

Thank you @alexander-schranz.

@nicolas-grekas nicolas-grekas merged commit 95becc4 into symfony:4.4 Apr 19, 2020
@alexander-schranz alexander-schranz deleted the bugfix/filesystem-tag-aware-adapter-test branch April 20, 2020 08:29
This was referenced Apr 28, 2020
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