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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
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:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdds a ChangesLog Timeout Action Configuration Feature
Enterprise Submodule Update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 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. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #68964 +/- ##
================================================
- Coverage 76.3269% 74.9516% -1.3754%
================================================
Files 2041 2031 -10
Lines 562433 570432 +7999
================================================
- Hits 429288 427548 -1740
- Misses 132238 142756 +10518
+ Partials 907 128 -779
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. |
|
@bb7133: The following tests 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. |
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.