Skip to content

fix(kolog): stop watching kmsg log if boot time can't be read - #1933

Open
magic-peach wants to merge 1 commit into
kmesh-net:mainfrom
magic-peach:fix-kolog-boottime-failure
Open

fix(kolog): stop watching kmsg log if boot time can't be read#1933
magic-peach wants to merge 1 commit into
kmesh-net:mainfrom
magic-peach:fix-kolog-boottime-failure

Conversation

@magic-peach

Copy link
Copy Markdown
Contributor

/kind bug

Noticed this while looking at the dns resolver locking. If /proc/stat can't be read, getBootTime() returns an error and KmeshModuleLog logs it but keeps going with a zero-value bootTime. startTimestamp then ends up computed against year 1, which is something like 60 quadrillion microseconds - way past anything a real kmsg timestamp could ever be. So the staleness check in parseKmsgLine is true for every line, forever, and the kernel module logs just go dark for the rest of the process's life with no further indication anything's wrong.

Added a small canWatchKmsg check so it bails instead of spinning up a goroutine that can structurally never print anything.

NONE

If getBootTime() fails, KmeshModuleLog kept going with a zero-value
bootTime. startTimestamp then gets computed against year 1, which is
astronomically bigger than any real kmsg timestamp - so the 'timestamp
< appStartTimestamp' check in parseKmsgLine is true for every single
line, forever. End result: one error log line on startup and then
Kmesh's kernel module logs are just silently never printed again, no
matter what happens on the node.

Added a canWatchKmsg check so we bail out instead of running a feature
that can never do anything.

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
Copilot AI lite review requested due to automatic review settings August 17, 2026 17:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kmesh-bot
kmesh-bot requested a review from YaoZengzeng August 17, 2026 17:55
@kmesh-bot kmesh-bot added the kind/bug Something isn't working label Aug 17, 2026
@kmesh-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign yaozengzeng for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.54%. Comparing base (32fe3df) to head (03e5a19).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/kolog/kolog.go 40.00% 3 Missing ⚠️
Files with missing lines Coverage Δ
pkg/kolog/kolog.go 8.62% <40.00%> (+8.62%) ⬆️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae15e8a...03e5a19. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

kind/bug Something isn't working size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants