Skip to content

Conversation

@minminlittleshrimp
Copy link
Collaborator

No description provided.

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
@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

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.

3 participants