Repository navigation
config: support log timeout action - #68964
Conversation
|
@bb7133 I've received your pull request and will start the review. I'll conduct a thorough review covering code quality, potential issues, and implementation details. ⏳ This process typically takes 10-30 minutes depending on the complexity of the changes. ℹ️ Learn more details on Pantheon AI. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a ChangesLog Timeout Action Configuration Feature
Enterprise Submodule Update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🐰 A rabbit hops where logs may stall, Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #68964 +/- ##
================================================
- Coverage 76.3015% 71.8609% -4.4406%
================================================
Files 2041 2118 +77
Lines 554276 604658 +50382
================================================
+ Hits 422921 434513 +11592
- Misses 130455 168249 +37794
- Partials 900 1896 +996
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
lance6716
left a comment
There was a problem hiding this comment.
Seems there's no test to verify the behaviour. Maybe inject some blocking to IO and check panic / discard really work
|
@bb7133: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
# Conflicts: # DEPS.bzl # go.mod # go.sum
|
/test check-dev |
[LGTM Timeline notifier]Timeline:
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cfzjywxk, lcwangchao, terry1purcell, YangKeao The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
Issue Number: close #68968
Problem Summary:
TiDB currently uses
[log].timeoutto detect stuck log writes and panic when the timeout is reached. This keeps the existing fail-fast behavior, but some deployments may prefer to keep TiDB serving traffic and discard later log writes after the timeout is observed.What changed:
[log].timeout-actionto TiDB config, defaulting topanic.panicanddiscard, with case-insensitive validation/normalization.Log.ToLogConfig().[log].timeoutand[log].timeout-action.Valid values:
panic: keep the existing behavior and panic on timeout. This is the default.discard: after the timeout is observed, discard later log write/sync calls instead of panicking.Dependencies:
log.Config.TimeoutActionand the actual timeout action behavior.Tests
Manual test:
go test ./pkg/config -run 'TestLogConfig|TestLogTimeoutAction|TestConfig$' -count=1go test --tags=intest ./pkg/extension/enterprise/audit -run 'TestAuditLoggerUsesGlobalLogTimeoutConfig|TestAuditLogger$' -count=1git diff --checkSide effects:
panicremains the default and preserves existing behavior.discardmode may lose log records after a timeout is observed. It cannot cancel a goroutine already blocked in the underlying OS/file write; it only prevents later log write/sync calls from continuing to block or panic.Documentation:
Release note:
Summary by CodeRabbit
log.timeout-actionconfiguration option to control logging timeout behavior:panic(default) ordiscard(case-insensitive), with validation for invalid values.timeout-actionvalues.