Amichai Rothman created ARIES-2230:
--------------------------------------
Summary: 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
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)