COVESA/dlt-daemon

Message is lost in dlt-daemon.

Opened this issue · 0 comments

The message is lost if more than 65536 bytes of data accumulates in the receive buffer in the dlt-daemon.
The dlt-daemon reads up to 65535 bytes when retrieving a message from the receive buffer if the message is APP_MSG. (ref. dlt_receiver_init_global_buffer() function)
At this time, if there are more than 65536 bytes of data in the receive buffer, dlt-daemon usually cuts off the last message data read. As a result, the message data is error, and the message is discarded.(ref. commit: dlt-daemon: Handle partial message parsing in receiver buffer
Since this message data is being sent and received without problems (not a rare case as commented in dlt-daemon.c: ll.3561-3567), it is not retransmitted. In other words, this message is lost.
For this problem, it seems to me that it would be better to make the read size of message data in dlt-daemon the size of the receive buffer, rather than a fixed value of up to 65535.

To confirm this phenomenon, DaemonFIFOSize is set to 1MiB in dlt.conf and the following log sending program is used.

#include <stdio.h>
#include <stdlib.h>
#include <dlt.h>

DLT_DECLARE_CONTEXT(con_exa1);

int main()
{
    DLT_REGISTER_APP("TAPP", "Test App");

    DLT_REGISTER_CONTEXT(con_exa1, "TAPP", "Test Context");

    int i;
    for (i = 0; i < 5000; i++) {
        DLT_LOG(con_exa1, DLT_LOG_INFO, DLT_UINT32(i),
         DLT_STRING("TEST ################################################"));
    }

    DLT_UNREGISTER_CONTEXT(con_exa1);

    DLT_UNREGISTER_APP();
}