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

support timeout for write #1196

Open
wjhuang2016 opened this issue Nov 9, 2022 · 1 comment
Open

support timeout for write #1196

wjhuang2016 opened this issue Nov 9, 2022 · 1 comment

Comments

@wjhuang2016
Copy link

Is your feature request related to a problem? Please describe.
The file that the logger is writing is over a network. Writing a log should not be blocked forever if the network is down.

Describe the solution you'd like
A clear and concise description of what you want to happen.
Support a config item write timeout, we can use SetWriteDeadline() provided by golang for the opened filed.
If the deadline is reached, the log operation should be returned instead of blocked.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Is this a breaking change?
We do not accept breaking changes to the existing API. Please consider if your proposed solution is backwards compatible. If not, we can help you make it backwards compatible, but this must be considered when we consider new features.

Additional context
Add any other context or screenshots about the feature request here.
pingcap/tidb#35007

@prashantv
Copy link
Collaborator

Zap works with any io.Writer, so you could build a custom io.Writer that calls SetWriteDeadline as part of the Write call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants