[ 
https://issues.apache.org/jira/browse/ARIES-2230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Amichai Rothman closed ARIES-2230.
----------------------------------
    Fix Version/s: rsa-2.0.0
       Resolution: Fixed

> Race condition in TopologyManagerImpor handling of endpoint events
> ------------------------------------------------------------------
>
>                 Key: ARIES-2230
>                 URL: https://issues.apache.org/jira/browse/ARIES-2230
>             Project: Aries
>          Issue Type: Task
>          Components: Remote Service Admin
>    Affects Versions: rsa-1.16.1
>            Reporter: Amichai Rothman
>            Priority: Major
>             Fix For: rsa-2.0.0
>
>
> For every endpoint changed event, TopologyManagerImport updates the 
> possibilities and schedules a run of synchronizeImports on a separate 
> threads. The thread processes the updated snapshot at the moment of 
> processing (and not at the moment the event was triggered), which is correct 
> - it processes updated data and not stale data.
> However, two such threads running concurrently still create a race condition, 
> e.g. an added endpoint is checked by both to not exist, so both try to import 
> it and we get a duplicate import. We should synchronize the process so there 
> is only one execution running at a time. The waiting thread will start when 
> the current one finishes, and will either process additional updates or will 
> be a no-op if nothing changed.
> In addition, when receiving a RemoteServiceAdminEvent.IMPORT_UNREGISTRATION 
> event, it calls unimportRegistration directly which removes the import 
> potentially concurrently with synchronizeImports, so we should make sure 
> there is no race condition there as well.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to