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

dlt-receive inconsistency between console payload and output file #599

Open
Laximas opened this issue Feb 12, 2024 · 7 comments
Open

dlt-receive inconsistency between console payload and output file #599

Laximas opened this issue Feb 12, 2024 · 7 comments
Assignees
Labels

Comments

@Laximas
Copy link
Contributor

Laximas commented Feb 12, 2024

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

@Laximas
Copy link
Contributor Author

Laximas commented Feb 12, 2024

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!

@minminlittleshrimp minminlittleshrimp self-assigned this Feb 14, 2024
@Laximas
Copy link
Contributor Author

Laximas commented Feb 16, 2024

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

@Laximas
Copy link
Contributor Author

Laximas commented Feb 19, 2024

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

@Laximas
Copy link
Contributor Author

Laximas commented Feb 20, 2024

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
}

@Laximas
Copy link
Contributor Author

Laximas commented Mar 19, 2024

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

@minminlittleshrimp
Copy link
Collaborator

Hello,
Any update on this one?

@Laximas
Copy link
Contributor Author

Laximas commented Jun 12, 2024

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?

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

Successfully merging a pull request may close this issue.

2 participants