-
Notifications
You must be signed in to change notification settings - Fork 55
sample_app: improve error handling and event reporting in ProcessCmd #243
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
base: main
Are you sure you want to change the base?
Conversation
|
@ivanperez-keera @egyptiankarim @chrislgarry @zanzaben GitHub username: rajv79. Please let me know if any additional changes, information, or follow-ups are needed. Happy to address feedback. Thank you for your time and review |
|
Relevant comment (which I incorrectly left on the cFS repo that updated the submodule, rather than here): nasa/cFS#886 (comment) |
Hi, thank you for the feedback. I appreciate it. Regarding the issue tracking, there is currently no existing issue that specifically documents this behavior. I agree that creating an issue to describe the problem and tie the change to it formally would be helpful. I’m happy to open an issue and reference it in the commit message if that is preferred. On the implementation details: This change is intended to make error handling more explicit and defensive. Returning early on failure allows the function to separate error paths from the nominal execution path clearly, avoid using invalid table state, and reduce nested control flow. This pattern also makes it immediately clear that no further processing should occur once a table access or release failure is detected. The functional behavior remains unchanged in the success case, and the early returns are only taken on error paths where continued execution would not be meaningful. That said, if maintaining a single return point is preferred for consistency with existing cFS style, I’m happy to refactor the function accordingly. |
|
@ivanperez-keera Thanks for catching that. I’ve updated the code to initialize TblPtr to NULL for consistency, defensive clarity and corrected the error message in the table release failure path to reference “release” instead of “get”. Please let me know if anything else should be adjusted |
Describe the contribution
This contribution improves defensive error handling and operational visibility in the Sample App ground command processing logic.
Table access failure paths in SAMPLE_APP_ProcessCmd are now explicit, with errors reported via Event Services, error counters incremented, and clean early returns on failure.
Testing performed
Steps taken to test the contribution:
1.Built the Sample App using the standard cFS build configuration.
2. Verified nominal command execution is unchanged.
3. Verified table access failures generate error events and increment error counters
Expected behavior changes
System(s) tested on
-Hardware: PC
-OS: Windows (development environment)
-Versions: cFS Sample App (current main branch)
Additional context
This change follows standard cFS practices by improving robustness without altering functional behavior. The scope is intentionally small to support safe review and integration.
Third party code
No third-party code added.
Contributor Info - All information REQUIRED for consideration of pull request
-Full name: Vivek Raj (Personal contribution)
-Organization: Personal
-Contributor type: Individual
-CLA: Individual CLA will be completed and submitted as required
-Individual CLA form:
https://github.com/nasa/cFE/blob/master/docs/GSC_18128_Ind_CLA_form_1219.pdf