nasa / CF

The Core Flight System (cFS) CFDP application.
Apache License 2.0
76 stars 45 forks source link

Silence logic around error event broken on semaphore timeout #377

Closed skliper closed 1 year ago

skliper commented 1 year ago

Checklist (Please check before submitting)

Describe the bug If the semaphore times out there's no attempt to allocate a buffer. If a buffer isn't allocated and silent is false, an error event is sent claiming there was no buffer available.

https://github.com/nasa/CF/blob/b0269effd3c0c3f8120bba1abbdd50abcaf53e59/fsw/src/cf_cfdp_sbintf.c#L91-L116

This silent logic doesn't make any sense to me, since it's passed in as 0 from all the non-file data PDUs but 1 for data. If it was intended for the allocate buffer why only non-data PDUs? I doubt it was ever intended for the semaphore timeout.

To Reproduce I saw it when waiting for the semaphore to send an Eof PDU. Could probably see it on the metadata send, but I initialize w/ a nonzero sem count.

Expected behavior No event on semaphore timeout, this is nominal behavior for flow control. TBH I'm not a huge fan of a possible flooding event on the failure to get a buffer. I'd rather see a combined approach of a counter and probably a single event sent at the maximum rate of each HK cycle only when the counter increments.

Code snips See above.

System observed on: Ubuntu 20.04

Additional context None

Reporter Info Jacob Hageman - NASA/GSFC