COVESA/dlt-daemon

dlt-receive inconsistency between console payload and output file

Opened this issue · 7 comments

We have a pc where we run automated tests for a device where we use dlt-receive to print the DLT logs in a console while also saving them in a DLT file. The console output is also saved in a separate '.log' file with an internal app we developed. When trying to analyze some logs, we have noticed that while the logs are available in the console's output (our '.log' file), logs can not be found in the DLT file for quite some minutes.

In more detail, we have a script that runs this command and adds an event handler to capture and save every log line printed in the console in our own '.log' file.
The command is similar to 'dlt-receive.exe -a -o .\log.dlt -c 200M -p 3490 192.168.0.2' (we build the .exe with cygwin)
This command will of course also save the logs as a '.dlt' file. But apparently, lines are missing from the '.dlt' compared to '.log' for ~30 mins

Was thinking that maybe fsync could help resolve this issue. I opened a PR where fsync executes every 1 MB to minimize the performance impact. I would like to hear your feedback as well, thanks!

So the issue only happens when the device disconnects and we try to reconnect. On successful reconnection, it sometimes only logs in the console for the first minutes which can range from 5 to 30 and then starts saving them in the .dlt file which causes a lot of them to be missing. I haven't had the chance to check the behavior of the changes in the PR yet, will probably have some results on Monday

After our test my implementation doesn't seem to fix the issue. Will wait for your feedback. Will try to think of another solution in the meantime

Tried with a powershell script and it's the same. For example we had a log.7.dlt with a last log at 15:59, log.8.dlt starts at 16:24 but the console had already started logging at 16:00 after disconnecting from log.7.dlt. 24 minutes missing in log.8.dlt. The script was the following:

while ($true) {
    .\dlt-receive.exe -a -o ./DLT/log.dlt -c 200M -e 6d55bca54c -p 3490 192.168.0.2 | ForEach-Object {
        if ($_ -notmatch 'SYS-.FILE') {
            Write-Output $_
        }
    }
    Start-Sleep -Seconds 5
}

Tried it with WSL as well with the following script, same issue:

#!/bin/bash
 for (( ; ; ))
 do
  dlt-receive -a -o ./DLT/log_2024-03-15_15.41.35.dlt -c 200M -e b7bc8c6d48 -p 3490 192.168.0.2 | grep -v SYS-.FILE
  sleep 5
 done

Hello,
Any update on this one?

Hello, no unfortunately we still face the same error and we haven't analyzed this again for a while. Could you have a look on your side?