Skip to content

Conversation

@turboezh
Copy link

It seems like nested metadata load happens under certain conditions.

  1. IndexMetadataBuilder tries to get field config
  2. \Oro\Bundle\EntityConfigBundle\Config\ConfigModelManager::findFieldModel are called and it calls \Oro\Bundle\EntityConfigBundle\Config\ConfigModelManager::ensureFieldLocalCacheWarmed
  3. ensureFieldLocalCacheWarmed calls \Oro\Bundle\EntityConfigBundle\Entity\EntityConfigModel::getFields
  4. fields are loaded from DB
  5. Doctrine unserializes field data and calls autoloader
  6. autoloader calls getAllMetadata
  7. that eventually lead to IndexMetadataBuilder tries to get config of the same field
  8. findFieldModel are called again and it calls ensureFieldLocalCacheWarmed
  9. BUT we are still in previous ensureFieldLocalCacheWarmed call!

In the second pass in ensureFieldLocalCacheWarmed $this->fieldLocalCache[$className] is already set. But it is an empty array because the previous call of ensureFieldLocalCacheWarmed not finished yet.
So findFieldModel returns nothing and the exception are thrown.

This pull request does not fixes nested calls. But it prevents incorrect local field cache warm up.

@turboezh turboezh closed this Jun 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant