-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dlt-system: move journal reading to its own thread (#471)
Reading from journal uses an endless loop which only exits when no new messages are read from the journal. This is a problem when the local buffer of the application gets filled i.e. due dlt-daemon being busy and not accepting current messages. In this case the thread waits for 500ms and tries again to read messages from the journal. When new messages are available they also will be written to dlt. If this cycle continues for a while it is possible that other tasks, which use the same thread and are controlled via a timer, are not executed anymore as the funtion `get_journal_msg` will not exit. This will lead to termination through the systemd watchdog, as sd_notify is not called anymore. To circumvent this issue, reading logs from journald is moved into a separate thread. Furthermore this commit fixes some invalid free when no configuration is passed to dlt-system as well as adding missing initialization which also can lead to crashes. Although these issues are not responsible for the crash on the system, as they will only happen on application shutdown. Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
- Loading branch information
Showing
4 changed files
with
65 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters