Commit 4b0b4ec4 authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: Fix deadlock happening when generating a new UID while installing bt5 (7d31f4fb).

7d31f4fb allowed to prevent duplication of Component, as the ID was not enough,
for example when renaming a Component. As getUid() may trigger generation of a
new UID (and thus relying on portal_ids) and is protected by a non-reentrant
lock, it may deadlock when generating Component registry_dict while loading
Portal Types.
parent 678e795f
......@@ -126,7 +126,7 @@ class ComponentDynamicPackage(ModuleType):
reference = component.getReference(validated_only=True)
self.__registry_dict.setdefault(reference, {})[version] = (
component.getId(),
component.getUid())
component._p_oid)
return self.__registry_dict
......
......@@ -237,7 +237,7 @@ class ComponentMixin(PropertyRecordableMixin, Base):
if (component_id is not None and component_uid is not None and
not reference_has_error and
component_uid != self.getUid() and component_id != self.getId()):
component_uid != self._p_oid and component_id != self.getId()):
error_list.append(
ConsistencyMessage(self,
object_relative_url,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment