#1196·zap

support timeout for write

Author: wjhuang2016Created Nov 9, 2022Updated Aug 25, 2026

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. https://github.com/pingcap/tidb/issues/35007