-
Notifications
You must be signed in to change notification settings - Fork 207
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
CFE_ES_RunLoop increments the main task ExecutionCounter rather than the task that called it #567
Comments
FWIW I recently got some questions from app developers about this (wanting to know whether the exec counter should be incremented in child tasks) - the change suggested would clarify that. I did get the sense from those users that they wanted a way to track the execution of child tasks in addition to the main task. |
@ejtimmon After initially writing this issue I then rediscovered that there is a function called So yes, there is actually the notion of a child task counter.... But then it is still unclear to me why the I suggest one of the following:
At the very minimum, it is probably at least worth a note in the documentation of CFE_ES_RunLoop that it is incrementing a task counter (whichever one it is) because the documentation doesn't seem to mention it at all, and this could certainly confuse someone (it confused me...). Probably worth a quick discussion to see what others think... |
Whenever a decision is made, we should also add guidance to the App Developer's Guide. |
CCB 2020-03-25: Discussed, will have telemetry impacts based on app vs task counter. Will also affect Health and Safety's behavior. Behavior needs to be documented in users guide, document that "run loop" should be called from main task. |
Is this needed for Caelum? Should we touch on again in CCB? |
Note that previous changes in this area did in fact change If guidelines/templates were followed this is no effective change because |
If anything we should just update the documentation of |
Implementation change addressed by #598. Remaining work here is to update documentation. |
Fix #567, Document CFE_ES_RunLoop increment task counter behavior
Is your feature request related to a problem? Please describe.
Inside the
CFE_ES_RunLoop()
function itself, it looks up the MainTaskId of the caller and only increments that execution counter, not the execution counter of its own task record. This means no matter what child task actually calls this function, it implements the execution counter of the main task only.Note that if the real main task is doing something else and also increments its own task counter, this is a race condition.
Describe the solution you'd like
I suggest one of the following:
CFE_ES_RunLoop()
invokeCFE_ES_IncrementTaskCounter()
to increment the counter for the task from which it was called. So if it gets called from a child task, then that child task gets incremented, not the main task. This is at least straightforward/consistent and avoids the race condition.CFE_ES_IncrementTaskCounter
to account for other regular task activity.Additional context
Noticed this when fixing #480 and it seemed rather odd/incorrect to be storing the ExecutionCounter where it is. This causes the code to jump to other entries in the table for the sole purpose of reading/updating this value, when it already had the correct app record to start.
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: