-
Notifications
You must be signed in to change notification settings - Fork 215
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
Posix socket OS_QueueGet() timeout fails #189
Comments
Imported from trac issue 166. Created by abrown4 on 2016-04-26T12:56:33, last modified: 2019-05-29T14:19:13 |
Trac comment by abrown4 on 2016-05-25 12:28:44: Running the oscore-test unit test with mqueue vs. sockets (changed in osconfig.h) shows a failure: '''diff ut_oscore_log_mqueue.txt ut_oscore_log_socket.txt'''
|
Trac comment by abrown4 on 2016-05-25 17:10:49: The fix: else logic for correct logic flow were omitted. "IF-ELSEIF" logic flow for the case where an item was actually read from the socket (with a timeout) would still result OS_QUEUE_TIMEOUT when it should have been OS_SUCCESS. Original unit test logic didn't cover this so I added some tests. Branch: trac-166-posix-socket-queueget |
Trac comment by abrown4 on 2016-05-25 18:00:27: Replying to [comment:1 abrown4]: |
Trac comment by jphickey on 2018-05-22 13:29:43: CCB 2018-05-22:
|
Trac comment by jhageman on 2019-03-04 17:15:37: CCB - changesets from 5/25/2016 already merged into master, close? Possibly open another ticket to deprecate socket queue use? |
Trac comment by jhageman on 2019-05-29 12:39:51: CCB 5/29/2019 - Discussed, deprecate socket queue use. Next gen doesn't implement socket queues. Mark as fixed by NG and "wontfix" |
Fix nasa#189, Unit test for cfe_evs_task.c
We have Linux platforms where the Linux mqueue is not available and we have to use sockets. However, we're seeing a problem when using sockets vs. mqueues. When OS_QueueGet() is called with an actual timeout value (msec) the socket implementation appears to always return without properly reporting a message is present. SB messages pile up.
The outreach drone is one such platform and we see this in our CentOS Linux VM simulation platform (OSAL configured the same for consistency). (I have a unofficial report from another developer who encountered this as well.) I think I've seen this on is with the open-source release OSAL as well as the current development branch.
(Likely the default event filters prevented folks from seeing this if they weren't looking at the SB telemetry directly.)
Steps to reproduce:
{{{
@@ -287,17 +287,17 @@
** This filtering applies only to SB events.
** These parameters have a lower limit of 0 and an upper limit of 65535.
*/
-#define CFE_SB_FILTERED_EVENT1 CFE_SB_SEND_NO_SUBS_EID
-#define CFE_SB_FILTER_MASK1 CFE_EVS_FIRST_4_STOP
+#define CFE_SB_FILTERED_EVENT1 0
+#define CFE_SB_FILTER_MASK1 CFE_EVS_NO_FILTER
-#define CFE_SB_FILTERED_EVENT2 CFE_SB_DUP_SUBSCRIP_EID
-#define CFE_SB_FILTER_MASK2 CFE_EVS_FIRST_4_STOP
+#define CFE_SB_FILTERED_EVENT2 0
+#define CFE_SB_FILTER_MASK2 CFE_EVS_NO_FILTER
-#define CFE_SB_FILTERED_EVENT3 CFE_SB_MSGID_LIM_ERR_EID
-#define CFE_SB_FILTER_MASK3 CFE_EVS_FIRST_16_STOP
+#define CFE_SB_FILTERED_EVENT3 0
+#define CFE_SB_FILTER_MASK3 CFE_EVS_NO_FILTER
-#define CFE_SB_FILTERED_EVENT4 CFE_SB_Q_FULL_ERR_EID
-#define CFE_SB_FILTER_MASK4 CFE_EVS_FIRST_16_STOP
+#define CFE_SB_FILTERED_EVENT4 0
+#define CFE_SB_FILTER_MASK4 CFE_EVS_NO_FILTER
#define CFE_SB_FILTERED_EVENT5 0
#define CFE_SB_FILTER_MASK5 CFE_EVS_NO_FILTER
}}}
As expected, running with mqueues by default, there will be no significant event messages after:
{{{
ES Startup: CFE_ES_Main entering OPERATIONAL state
}}}
Now, to switch to sockets and show the problem:
7) Edit build/cpu1/inc/osconfig.h as:
{{{
@@ -132,7 +132,7 @@
** This define sets the queue implentation of the Linux port to use sockets
** commenting this out makes the Linux port use the POSIX message queues.
/
-/ #define OSAL_SOCKET_QUEUE */
+#define OSAL_SOCKET_QUEUE
/*
** Module loader/symbol table is optional
}}}
8) make clean;make
9) cd exe and run core-linux.bin & wait for 30-60 seconds, you'll see:
{{{
1980-012-14:03:20.26138 ES Startup: CFE_ES_Main entering OPERATIONAL state
Warning: System Log full, log entry discarded.
EVS Port1 66/1/CFE_TIME 21: Stop FLYWHEEL
EVS Port1 66/1/CFE_SB 17: Msg Limit Err,MsgId 0x1808,pipe ES_CMD_PIPE,sender SCH_LAB_APP
EVS Port1 66/1/CFE_SB 17: Msg Limit Err,MsgId 0x1808,pipe ES_CMD_PIPE,sender SCH_LAB_APP
EVS Port1 66/1/CFE_SB 17: Msg Limit Err,MsgId 0x1808,pipe ES_CMD_PIPE,sender SCH_LAB_APP
EVS Port1 66/1/CFE_SB 17: Msg Limit Err,MsgId 0x1885,pipe CI_LAB_CMD_PIPE,sender SCH_LAB_APP
EVS Port1 66/1/CFE_SB 17: Msg Limit Err,MsgId 0x1883,pipe SAMPLE_CMD_PIPE,sender SCH_LAB_APP
EVS Port1 66/1/CFE_SB 17: Msg Limit Err,MsgId 0x1808,pipe ES_CMD_PIPE,sender SCH_LAB_APP
EVS Port1 66/1/CFE_SB 17: Msg Limit Err,MsgId 0x1885,pipe CI_LAB_CMD_PIPE,sender SCH_LAB_APP
EVS Port1 66/1/CFE_SB 17: Msg Limit Err,MsgId 0x1883,pipe SAMPLE_CMD_PIPE,sender SCH_LAB_APP
EVS Port1 66/1/CFE_SB 17: Msg Limit Err,MsgId 0x1808,pipe ES_CMD_PIPE,sender SCH_LAB_APP
EVS Port1 66/1/CFE_SB 17: Msg Limit Err,MsgId 0x1885,pipe CI_LAB_CMD_PIPE,sender SCH_LAB_APP
EVS Port1 66/1/CFE_SB 17: Msg Limit Err,MsgId 0x1883,pipe SAMPLE_CMD_PIPE,sender SCH_LAB_APP
}}}
Each of these apps/services invokes CFE_SB_RcvMsg() with a timeout value:
They delegate to CFE_SB_ReadQueue() and to OS_QueueGet() with a timeout value.
The text was updated successfully, but these errors were encountered: