Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #978, put task parameters into task record #1151

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

jphickey
Copy link
Contributor

@jphickey jphickey commented Feb 3, 2021

Describe the contribution
Encapsulate all parameters for apps and tasks into a structure object and clean up internal APIs to pass this object rather than individual parameters. These parameters can then easily be stored with the relevant record in the internal table (tasks, apps, libs) and makes management easier - as code copies one object rather than many individual fields with (potentially) different names.

All parameters are stored in the record, which facilitates future telemetry generation/stats and/or for when an app might get restarted or reloaded in the future.

Notably this changes all task startup to go through the same basic routine (there is no longer a need for different accounting between main tasks and child tasks) and share the same common entry point.

Fixes #978

Testing performed
Build and sanity check CFE. In particular ensure that all tasks + child tasks are starting and running normally. Also checked that the app restart command is working as expected.

Run all unit tests and confirm coverage.

Expected behavior changes
No public API change. Internal APIs are simplified, internal data structures are more consistent, and more detail is stored with the relevant record (i.e. task record has all relevant task details, so when looking up task info one does not have to traverse to the app record which previously held some of this data).

System(s) tested on
Ubuntu 20.04

Additional context
Using the common entry point for child tasks avoids a theoretical race condition where the child task might not have been fully accounted for in the global table at the time the user function started execution. Previously this would directly invoke the user-supplied function immediately. Now using the common entry point this delays until the task record is completely accounted for (linked back to app, etc) before calling the user function. So functions such as CFE_ES_GetAppID() and others will work right from the beginning.

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey marked this pull request as draft February 3, 2021 14:31
@jphickey
Copy link
Contributor Author

jphickey commented Feb 3, 2021

This needs a rebase after next baseline. Submitting as draft to get review started, actual change is in commit a0cda23.

@jphickey jphickey added the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label Feb 3, 2021
@astrogeco astrogeco added CCB:2021-02-02 and removed CCB:Ready Ready for discussion at the Configuration Control Board (CCB) labels Feb 3, 2021
@astrogeco
Copy link
Contributor

astrogeco commented Feb 3, 2021

CCB:2021-02-02 APPROVED

  • update comment on cfe_es_apps

Implement a "CFE_ES_TaskStartParams_t" to complement the
existing "CFE_ES_AppStartParams_t" and store this in the
task record.

This permits some nice cleanup:

- All tasks can now use the same basic start function CFE_ES_StartAppTask()
- No special/different logic is needed for main tasks/child tasks
- Simplified APIs as parameters can be encapsulated in a single struct.
- Fixes a race condition where child tasks may not be fully instantiated
  at the time the task function is invoked.
@jphickey
Copy link
Contributor Author

Rebased to "main" - this is ready to go now.

@jphickey jphickey marked this pull request as ready for review February 16, 2021 20:06
@astrogeco astrogeco changed the base branch from main to integration-candidate February 17, 2021 15:26
@astrogeco astrogeco merged commit 414036e into nasa:integration-candidate Feb 24, 2021
astrogeco added a commit to nasa/cFS that referenced this pull request Feb 24, 2021
nasa/cfe #1168
nasa/cfe #1158
nasa/cFE#1151
astrogeco added a commit to nasa/cFS that referenced this pull request Feb 26, 2021
@jphickey jphickey deleted the fix-978-entrypt branch March 10, 2021 14:43
@skliper skliper added this to the 7.0.0 milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move entry point address info from app table to task table
3 participants