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
StartFlushDaemon: add API with more control over flushing #307
Conversation
Previously, periodic flushing was started automatically when writing to buffered files for the first time. When writing to a Logger which buffers internally, then using the same periodic flushing makes sense. In that case it has to be started explicitly. The new call grants the caller control over the flush interval. Kubernetes has a parameter for that.
/hold Let's do a full test run with this code in Kubernetes: kubernetes/kubernetes#108725 |
StopFlushDaemon() | ||
logging.flushD.run(interval) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gets used in Kubernetes like this:
/assign @thockin @serathius |
/hold cancel Test in Kubernetes with usage of the new API call was successful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems OK to me.
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dims, pohly, thockin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/kind feature
What this PR does / why we need it:
Previously, periodic flushing was started automatically when writing to
buffered files for the first time. When writing to a Logger which buffers
internally, then using the same periodic flushing makes sense. In that case it
has to be started explicitly.
The new call grants the caller control over the flush interval. Kubernetes has
a parameter for that.
Special notes for your reviewer:
This will be used to fix a race condition that was found in Kubernetes' own periodic flushing.
Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.
Release note: