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

Rework no message buffer error reporting to not spam #378

Open
3 tasks done
skliper opened this issue Apr 7, 2023 · 0 comments
Open
3 tasks done

Rework no message buffer error reporting to not spam #378

skliper opened this issue Apr 7, 2023 · 0 comments

Comments

@skliper
Copy link
Contributor

skliper commented Apr 7, 2023

Checklist (Please check before submitting)

  • I reviewed the Contributing Guide.
  • I reviewed the CF README.md file to see if the feature is in the major future work.
  • I performed a cursory search to see if the feature request is relevant, not redundant, nor in conflict with other tickets.

Is your feature request related to a problem? Please describe.

Fix for #377 only addressed removal of error event on nominal semaphore timeout (flow control). When a message buffer isn't available, this error event will flood when silent is false since every wakeup CF will try to resend the PDU. Note silent is set to false on all non-file data PDUs.

I didn't see any justification for why the code was implemented this way (no event for file data PDUs, events on the rest).

This is the snip before the fix for #377.

if (OS_ObjectIdDefined(c->sem_id))
{
os_status = OS_CountSemTimedWait(c->sem_id, 0);
}
else
{
os_status = OS_SUCCESS;
}
/* Allocate message buffer on success */
if (os_status == OS_SUCCESS)
{
CF_AppData.engine.out.msg = CFE_SB_AllocateMessageBuffer(offsetof(CF_PduTlmMsg_t, ph) + CF_MAX_PDU_SIZE +
CF_PDU_ENCAPSULATION_EXTRA_TRAILING_BYTES);
}
if (!CF_AppData.engine.out.msg)
{
c->cur = t; /* remember where we were for next time */
if (!silent)
{
CFE_EVS_SendEvent(CF_EID_ERR_CFDP_NO_MSG, CFE_EVS_EventType_ERROR,
"CF: no output message buffer available");
}
success = false;
}

Describe the solution you'd like
I think it would be more useful to know it happened and a count of how often. Consider adding a counter for both semaphore timeouts and no message buffer available. Only send an event on the HK cycle when "no message buffer" counter increments, and report both in HK.

Describe alternatives you've considered
Could just send the event once when the no message buffer available count transitions to non-zero.

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants