pnoltes commented on PR #414:
URL: https://github.com/apache/celix/pull/414#issuecomment-1097040371
If I remember correctly the remote service topology manager has 3 locks and
even 2 as recursive locks, because registering service during import can loop
back to the topology manager.
For example:
- Component A has a required dependency to Service1 and
- Component A provides a - marked for remote - Service2 when active
- Topology manager import a remote Service1 -> during importService, this
activates Component A -> during importService, topology manager tries to
export Service2.
But a while back the dfi export_registration has been updated to track
service trackers async and (more importantly) the dfi import_registration has
been updated to register service async:
https://github.com/apache/celix/blob/0913af41282e029fc19b03b930267ba5829c4608/bundles/remote_services/remote_service_admin_dfi/src/import_registration_dfi.c#L155
This means that a import/export service can be safely completed before the
service tracker / service registration is picked up by the Celix event thread.
I prefer that we require the RSAs to start service tracker / register
service async during export / import and simplify the remote service topology
manager.
If you agree, I think we should refactor the topology manager to use a
single lock or mutex and thus avoid the whole ABBA situation.
WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]