klog 1.130.0: race condition during periodic flushing and rotating files #407
Labels
kind/bug
Categorizes issue or PR as related to a bug.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
/kind bug
What steps did you take and what happened:
#403 moved the Sync method call out of the protection of the
l.mu
mutex. However, that means that the access tosb.file
is no longer protected inside that method.What did you expect to happen:
Let's remove the
flushSyncWriter
interface. We can instead useio.Writer
and when it comes to flushing, check directly for thesyncBuffer
type to flush and sync.Also, avoid allocating a slice each time flushing is done.
Anything else you would like to add:
Found during review of kubernetes/kubernetes#125531.
The text was updated successfully, but these errors were encountered: