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

Fixes data loss for the log rotator #246

Merged
merged 1 commit into from
Oct 30, 2024
Merged

Fixes data loss for the log rotator #246

merged 1 commit into from
Oct 30, 2024

Conversation

FedericoPonzi
Copy link
Owner

@FedericoPonzi FedericoPonzi commented Oct 30, 2024

Motivation and Context

The last feature merged, the log rotation, had a flaky test randomly failing. See the last deps update merged to master: https://github.com/FedericoPonzi/Horust/actions/runs/11583491268/attempts/1

Description

This is from BufReader description:

When the BufReader is dropped, the contents of its buffer will be discarded. Creating multiple instances of a BufReader on the same stream can cause data loss.
Now one BufReader is created at the beginning and held throughout.

How Has This Been Tested?

Generally improved the associated test by removing some magic. Now it seems to be working very well, consistently passing the test.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@FedericoPonzi FedericoPonzi force-pushed the fix-logrotator branch 3 times, most recently from c608ff2 to fed335d Compare October 30, 2024 19:21
@FedericoPonzi FedericoPonzi merged commit e9a03f5 into master Oct 30, 2024
6 checks passed
@FedericoPonzi FedericoPonzi deleted the fix-logrotator branch October 30, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant