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

CFE_SB_GetLastSenderId() broken -- could result in lost messages or echoes #30

Closed
CDKnightNASA opened this issue Jun 25, 2020 · 2 comments

Comments

@CDKnightNASA
Copy link
Contributor

When discussed at the cFS CCB yesterday, I realized that the CFE_SB_GetLastSenderId() function, as used by SBN, is not correct. The problem is that SBN needs a way to determine whether a message it is reading off the bus is a message that SBN just published to that bus. SBN checks the last sender and ignores the message when the last sender is SBN. This is fine in the case where SBN is reading the last message on the bus, but if there are multiple messages on the bus, the GetLastSenderId() returns the last sender, not the sender of the message currently being read.

For example, if the the pipe had:
1 SCH wakeup
2 SBN CI msg from peer
3 LC result

When SBN reads the pipe, it reads msg 1 and sees that the sender is LC It reads messages 2 and sees that the sender is LC. Only when it reads 3 does it have the right sender.

The CFE_SB_RcvMsg API is being enhanced to address this and GetLastSenderId() being removed. Using either task-based reading of the pipes (which wakes up as soon as a message is published on that pipe, ensuring only one message on the pipe) or using a high read frequency will help reduce the likelihood of a problem.

Soon, I'll be committing a change that uses a new RcvMsg API that will be available in a pull request.

@CDKnightNASA
Copy link
Contributor Author

see nasa/cFE#759

@CDKnightNASA
Copy link
Contributor Author

fixed in 330eba0

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

No branches or pull requests

1 participant