directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vaclav Havlik" <>
Subject Perhaps a race condition.
Date Tue, 15 Mar 2016 09:05:43 GMT
perhaps I am wrong, but I suspect myself of seeing a bug in Apache Directory Studio 2.0.0.v20151221-M10.

In EntryEditorManager.updateAutoSaveSharedReferenceCopy (runs in main thread)

-> EntryEditorUtils.ensureAttributesInitialized(entry);
  -> StudioBrowserJob runs InitializeAttributesRunnable in a thread
        -> initializeAttributes( entry, monitor ) -> initializeAttributes( entry, returningAttributes,
true, monitor )
           -> entry.deleteAttribute( oldAttribute ) -> ai.attributeMap.remove(Strings.toLowerCase(oidString));

-> new CompoundModification().replaceAttributes(entry, workingCopy, this);
     -> fromEntry.getAttributes() -> ai.attributeMap.values()

Thus, the 1st thread modifies ai.attributeMap and at the same time the 2nd thread reads it.
Only initializeAttributes is synchronized, but on its class object.

Is it not a race condition?

Thank you. With regards Vaclav Havlik.

View raw message