-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Introduce PSR-6 for metadata caching #8651
Introduce PSR-6 for metadata caching #8651
Conversation
Bumping to 2.2.0 does not look like a big deal dependency-wise (the only added dependency is |
I wanted to release after 2.9 and the bundle releases to avoid unnecessary deprecation warnings users can't avoid |
@greg0ire any guidance on those failures? I don't see how changing the metadata cache could cause these failures 🤔 |
Another issue I do not reproduce locally 😩 … caching issues are the worst! |
Let's check if it is transient, but there are 2 more recent PRs that did not have this failure, so this time I think it really does come from the code in the PR. |
I don't understand, but I see that class metadata is involved at some point: orm/lib/Doctrine/ORM/UnitOfWork.php Lines 2181 to 2199 in 9a48450
|
Ah I think it's starting to make sense: orm/lib/Doctrine/ORM/UnitOfWork.php Lines 3153 to 3158 in 9a48450
I can reproduce the issue locally with |
Thanks for investigating. I'll debug and see what breaks this. Thanks! |
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.
Thank you.
I reviewed the implementation. Im happy with it. I did not dig into the tests.
@greg0ire you're right, I can reproduce the failure locally, but I can also reliably reproduce this in 2.9.x. This looks very much unrelated to this patch. |
Indeed, me too! UPDATE: I don't reproduce it when running the same phpunit command as in the CI though: Notice the |
I bisected it down to Reducing the test to just the following is enough to make <?php
declare(strict_types=1);
namespace Doctrine\Tests\ORM\Functional;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\Tests\Models\CMS\CmsArticle;
use Doctrine\Tests\Models\CMS\CmsGroup;
use Doctrine\Tests\Models\CMS\CmsPhonenumber;
use Doctrine\Tests\Models\CMS\CmsUser;
use Doctrine\Tests\Models\DDC2504\DDC2504ChildClass;
use Doctrine\Tests\Models\DDC2504\DDC2504OtherClass;
use Doctrine\Tests\OrmFunctionalTestCase;
use function array_shift;
use function assert;
use function count;
/**
* Description of ExtraLazyCollectionTest
*/
class ExtraLazyCollectionTest extends OrmFunctionalTestCase
{
protected function setUp(): void
{
parent::setUp();
$class = $this->_em->getClassMetadata(CmsUser::class);
// drop that line and IdentityMapTest::testCollectionValuedAssociationIdentityMapBehaviorWithRefresh fails
unset($class->associationMappings['phonenumbers']['cache']);
}
public function testContainsKeyNonExistentIndexByManyToMany(): void
{
}
} Both tests deal with phonenumbers, and the line that makes the subsequent test pass has to do with metadata cache, so it's starting to make some sense. |
Blocked by #8659 (and a merge up) |
Co-authored-by: Grégoire Paris <[email protected]>
411468a
to
f634c64
Compare
Or maybe revert those, add them back later? |
Let's talk about the aforementioned issue first? I think the deprecations introduced in doctrine/persistence#144 should be reverted if it is what we are talking about, until all calling projects have adapted. Then, in a subsequent PR, we can reintroduce them, and we might want to use |
Summary of discussion with @greg0ire:
With that in mind, I think this PR is ready for review. |
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.
Please summarize the deprecations in UPGRADE.md
I think i can do the deprecation summarization as part of the general 2.9 work, as this is not done for a few deprecations yet. |
In that case, let's go! |
Thanks @alcaeus ! |
Closes #8650.
This bumps the doctrine/cache dependency to the just-released 1.11 version that includes the PSR-6 adapters needed for compatibility code. The dependency to doctrine/persistence does not to be bumped; instead we check if doctrine/persistence supports PSR-6 caching. I can update this if requested.