-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Bugfix/empty seq #3025
base: devel
Are you sure you want to change the base?
Bugfix/empty seq #3025
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor changes and questions.
severity warning high \ | ||
id 25 \ | ||
format "Sequence file is empty. Ignoring." | ||
#format "Sequence file {} is empty. Ignoring." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to clean-out the commented out code. Preferably we'd include the sequence name.
What scenario would this hit? Doesn't the sequence validation catch this (e.g. the CRC)?
Additionally, can this code be hit while a sequence is running? (e.g. the sequence file wasn't fully uplinked).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So actually, to encompass both cases, a more elegant solution could be to simply verify the number of records when loading the sequence file at FPrimeSequence
level, and return false if the number of records is zero, which would trigger the following events:
This would be the minor change:
bool CmdSequencerComponentImpl::FPrimeSequence ::
validateRecords()
{
Fw::SerializeBufferBase& buffer = this->m_buffer;
const U32 numRecords = this->m_header.m_numRecords;
Sequence::Record record;
if (numRecords == 0)
{
return false;
}
( ... )
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the FileEmpty solution may be technically inaccurate as the file still contains a sequence header and so is not literally empty. If we're going to use an event, maybe we'd better call it SeqEmpty
or NoRecords
, and make it clear in the error message that there specifically weren't any commands in the sequence. I like the second solution better, if this is the direction we choose to go.
@timcanham and @zimri-leisher I'd appreciate your thoughts on this PR. |
I would add/modify a unit test to check this behavior. EDIT--On second thought, instead of EXECUTION_ERRORing, should we just allow the user to run empty sequences? My team intentionally did this and thought it would work (we were using the seq as a placeholder). In general tools should allow as much valid input as possible to make the fewest decisions for users. Maybe we could still raise a warning just in case it was a mistake. |
Change Description
Implemented FileEmpty warning for the
Svc::CmdDispatcher
Component, which is called when deserializing the next record returns an empty buffer.Rationale
The Flight Software should raise a warning on empty command sequence files instead of crashing.
Testing/Review Recommendations
Future Work