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

Apps should not pend forever on software bus #55

Open
jphickey opened this issue Apr 9, 2020 · 3 comments · May be fixed by #144
Open

Apps should not pend forever on software bus #55

jphickey opened this issue Apr 9, 2020 · 3 comments · May be fixed by #144
Labels
enhancement New feature or request

Comments

@jphickey
Copy link
Contributor

jphickey commented Apr 9, 2020

The SAMPLE_APP, which is supposed to exemplify the current best practices, shouldn't be pending forever on a software bus message as it does here:

status = CFE_SB_RcvMsg(&SAMPLE_AppData.MsgPtr,
SAMPLE_AppData.CommandPipe,
CFE_SB_PEND_FOREVER);

The problem with pending forever is that the app also needs to perform an orderly exit if a restart/reload/delete command is sent to ES, which is checked by CFE_ES_RunLoop(). If an app is pending forever for software bus messages but none are sent, then the shutdown request will remain pending indefinitely.

@jphickey
Copy link
Contributor Author

jphickey commented Apr 9, 2020

Update - I did test this and confirm that the ES will actually forcibly delete the task via an OS_TaskDelete if it doesn't exit itself within the delay period. So the app actually will still get restarted, but forcibly deleting an app via that method is not good because it will leak any resources that the app was using at the time it was deleted.

As a best-practice example, it should use a time-limited pend on the software bus, so it can also poll the CFE_ES_RunLoop() function.

@jphickey jphickey added the enhancement New feature or request label Apr 9, 2020
@jphickey
Copy link
Contributor Author

jphickey commented Apr 9, 2020

Calling this an "enhancement" rather than a "bug" because it is also saved by the fact that SCH_LAB by default sends a message every few seconds, so while less than ideal, its not fully broken.

@skliper skliper added this to the 1.2.0 milestone Apr 9, 2020
@skliper
Copy link
Contributor

skliper commented Apr 9, 2020

Added milestone, feel free to fix if you want

@skliper skliper removed this from the 1.2.0 milestone Aug 21, 2020
jphickey added a commit to jphickey/sample_app that referenced this issue Mar 29, 2021
Apps should not pend forever on software bus receive, because
they should also periodically check CFE_ES_RunLoop even if no
commands were received.
@jphickey jphickey linked a pull request Mar 29, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants