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

data race: avoid unprotected access to sb.file #408

Merged
merged 1 commit into from
Jun 20, 2024

Commits on Jun 18, 2024

  1. data race: avoid unprotected access to sb.file

    79575d8 (included in klog v1.130.0) added a small data race with regards to
    accessing the syncBuffer.file field when calling Sync.
    
    We can eliminate the entire redirectBuffer interface that led to this mistake
    and instead work directly with syncBuffer for flushing and syncing.
    
    To avoid allocating a slice inside flushAll, a fixed-sized struct is
    returned. A benchmark confirms that flushAll+syncAll can be called without
    allocations.
    pohly committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    2327d4c View commit details
    Browse the repository at this point in the history