nasa / cFE

The Core Flight System (cFS) Core Flight Executive (cFE)
Apache License 2.0
412 stars 206 forks source link

Remove `CFE_TBL_GetAddresses` and `CFE_TBL_ReleaseAddresses` APIs #1496

Open skliper opened 3 years ago

skliper commented 3 years ago

Is your feature request related to a problem? Please describe. These two APIs are out of family, no others take arrays of handles. Not a significant benefit to maintain this capability.

Describe the solution you'd like Remove these two APIs

Describe alternatives you've considered Could provide handle array API's for all the standard TBL calls (Register, Manage, etc), but really needs a use case since it's rare to see the existing APIs used in the wild.

This isn't really all that great since it doesn't allow for individual error handling. Maybe "all or nothing" sort of error handling is ok, but should be considered in the trade.

Additional context Code review

Requester Info Jacob Hageman - NASA/GSFC

jphickey commented 3 years ago

I actually consider these APIs to be fundamentally broken because if a failure occurs on getting address of one (but not all) of the tables, it continues on but does not set the output pointer, and does not indicate which pointer(s) were set and which were not in the end. Calling "ReleaseAddresses" on the same array may induce undefined behavior as it may release a handle that was never gotten.

Basically, if "CFE_TBL_GetAddresses" returns non-success, the system is left in an indeterminate state. It may have done a partial job but doesn't tell you which part, nor how to properly clean up/revert whatever it did.