nasa / CF

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

Transaction priority sorted incorrectly #442

Open ctolbert555 opened 2 months ago

ctolbert555 commented 2 months ago

Checklist (Please check before submitting)

Describe the bug Priority sorting of transactions is inaccurate.

To Reproduce Steps to reproduce the behavior:

  1. Set up two polling directories, dir 1 with non-zero priority, dir 2 with zero priority.
  2. Disable CF wakeups
  3. Copy file 1 to dir 1
  4. Copy file 2 to dir 2
  5. Enable CF wakeups (to ensure both transactions are processed the same wakeup)
  6. Bug: file 1 will be sent before file 2 (file 2 will be placed in the pending queue after file 1)

Expected behavior file 2 should be prioritized over file 1, and placed in the pending queue before file 1

System observed on:

Suggested Fix Create a new static inline function _CF_CList_InsertFrontEx in cf_utils.h Replace _CF_CList_InsertBackEx with _CF_CList_InsertFrontEx in _CFInsertSortPrio in cf_utils.c and update variable name from _insertback to _insertfront in _CFInsertSortPrio in cf_utils.c

Reporter Info Corey Tolbert, JSC cFS team