openbmc / phosphor-objmgr

Phosphor Object Manager
Apache License 2.0
6 stars 8 forks source link

Mapper: Watch for association endpoint creation to create new associations #15

Closed spinler closed 5 years ago

spinler commented 5 years ago

If an object creates an org.openbmc.Associations instance with an associations property that contains a reverse association that doesn't exist yet, ideally the mapper should keep track of that and if that object is created in the future, then the association object should then be created. This could happen if a process that had the association endpoint restarts.

For example, if the associations property is written to

['forward', 'reverse', 'pathA']

but the 'pathA' object doesn't exist at that moment, then when it is finally created the mapper should create the 'pathA/reverse' object at that time.

The original python mapper does it this way.

spinler commented 5 years ago

@edtanous FYI - @bradbishop pointed out this missing functionality

spinler commented 5 years ago

I'm going to add pending association support to the mapper, to only create the association objects while both endpoints exist. Otherwise, it will keep them off to the side in a pending list until they both come back again and the association objects can be recreated.

feistjj commented 5 years ago

I also found that ['forward', '', 'pathA'] still creates a path for the reverse, which I don't believe the old mapper did

spinler commented 5 years ago

Resolved by https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-objmgr/+/20331

spinler commented 5 years ago

done.