directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: Perhaps a race condition.
Date Tue, 15 Mar 2016 09:18:48 GMT
Le 15/03/16 10:05, Vaclav Havlik a écrit :
> Hello,
> 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
>     -> InitializeAttributesRunnable.run
>         -> 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.
Thanks a lot for the report.

May I suggest you create a JIRA so that it does not get forgotten ? We
may not be able to immediately analyze the problem, and in this case,
this mail will quickly be buried under an avalanche of other mails...



Mime
View raw message