directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Václav Havlík (JIRA) <j...@apache.org>
Subject [jira] [Commented] (DIRSTUDIO-1100) Race condition.
Date Wed, 16 Mar 2016 08:47:33 GMT

    [ https://issues.apache.org/jira/browse/DIRSTUDIO-1100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15197036#comment-15197036
] 

Václav Havlík commented on DIRSTUDIO-1100:
------------------------------------------

And also
EntryEditorUtils.updateAutoSaveSharedWorkingCopy .
Here, there is no EventRegistry.suspendEventFiringInCurrentThread() .


> Race condition.
> ---------------
>
>                 Key: DIRSTUDIO-1100
>                 URL: https://issues.apache.org/jira/browse/DIRSTUDIO-1100
>             Project: Directory Studio
>          Issue Type: Bug
>          Components: studio-ldapbrowser
>    Affects Versions: 2.0.0-M10 (2.0.0.v20151221-M10)
>         Environment: x86_64, Linux Debian 8, GTK
>            Reporter: Václav Havlík
>            Priority: Minor
>             Fix For: 2.0.0-M11
>
>
> Hello,
> perhaps I am wrong, but I suspect myself of seeing a bug in Apache Directory Studio 2.0.0.v20151221-M10.
> In method EntryEditorManager.updateAutoSaveSharedReferenceCopy (runs in main thread):
> Firstly:
> -> 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));
> Secondly:
> -> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message