Skip to content

Conversation

@minminlittleshrimp
Copy link
Collaborator

No description provided.

Signed-off-by: lum3hc <Minh.LuuQuang@vn.bosch.com>

This comment was marked as outdated.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a file synchronization issue in the DLT offline log storage system. The change corrects the file descriptor used for fsync operations when dealing with gzip-compressed log files.

  • Replaces fsync(fileno(config->log)) with fsync(config->fd) for proper file synchronization
  • Adds validation to ensure the file descriptor is valid before attempting fsync
  • Improves error handling with appropriate error messages for invalid file descriptors
Comments suppressed due to low confidence (1)

src/offlinelogstorage/dlt_offline_logstorage_behavior.c:1125

  • [nitpick] The error message could be more descriptive by including the actual file descriptor value to aid in debugging. Consider: "invalid file descriptor (%d) for log file sync"
                            dlt_vlog(LOG_ERR, "%s: invalid file descriptor for log file sync\n", __func__);

@minminlittleshrimp
Copy link
Collaborator Author

minminlittleshrimp commented Aug 3, 2025

Kindly review @lti9hc

@minminlittleshrimp minminlittleshrimp self-assigned this Aug 3, 2025
@minminlittleshrimp minminlittleshrimp changed the title logstorage: Use correct fd for fsync on gzip log files [Draft] logstorage: Use correct fd for fsync on gzip log files Aug 5, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@minminlittleshrimp minminlittleshrimp changed the title [Draft] logstorage: Use correct fd for fsync on gzip log files logstorage: Use correct fd for fsync on gzip log files Aug 19, 2025
@minminlittleshrimp
Copy link
Collaborator Author

Correct commit msg and commit title -> no gzip related

@alexmohr
Copy link
Contributor

alexmohr commented Dec 1, 2025

As the project was referenced automatically anyway but github, I wanted to share the dlt rust wrapper we just open sourced.
https://crates.io/crates/dlt-rs (wrapper only) and https://crates.io/crates/tracing-dlt (tracing sink)

Rust is more and more used in the automative world, so I was wondering if you're interested in linking the dlt crates I posted above somewhere in docs or readme.md?
It's a thin type safe rust wrapper around libdlt, so it makes sure that all communication with the daemon is done via the c library and no custom dlt logic is implemented in rust.

@LocutusOfBorg
Copy link
Contributor

Hello please also check the content of #788 and integrate it, there are some improvements too

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 this pull request may close these issues.

5 participants