Skip to content

feat: calculate boot time correctly if the time jumps#13

Merged
talos-bot merged 2 commits intomainfrom
feat/dynamic-boot-time
Mar 16, 2026
Merged

feat: calculate boot time correctly if the time jumps#13
talos-bot merged 2 commits intomainfrom
feat/dynamic-boot-time

Conversation

@smira
Copy link
Copy Markdown
Member

@smira smira commented Mar 13, 2026

Instead of capturing boot time difference with time.Now() just once at
the beginning of streaming kmsg events, re-check the time.Now() while
processing each message.

This fixes issue with kmsg logs as seens e.g. from RPi: as it has not
RTC, it might streaming ksmg logs while time is back at zero (1970), but
as NTP catches up, the stream still reports dates in 1970, not accepting
the fact that the NTP caught up.

smira added 2 commits March 13, 2026 21:39
Instead of capturing boot time difference with `time.Now()` just once at
the beginning of streaming kmsg events, re-check the `time.Now()` while
processing each message.

This fixes issue with kmsg logs as seens e.g. from RPi: as it has not
RTC, it might streaming ksmg logs while time is back at zero (1970), but
as NTP catches up, the stream still reports dates in 1970, not accepting
the fact that the NTP caught up.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
Fix linting issues.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
@github-project-automation github-project-automation bot moved this to To Do in Planning Mar 13, 2026
@talos-bot talos-bot moved this from To Do to In Review in Planning Mar 13, 2026
@smira smira requested a review from Copilot March 13, 2026 17:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to fix kernel message timestamp calculation when the system wall clock changes during a /dev/kmsg stream (e.g., devices without RTC that later sync via NTP), and also includes a broad regeneration/upgrade of project tooling and CI configuration.

Changes:

  • Rework boot-time handling in the reader to use a boot-time offset and re-evaluate time.Now() while parsing messages.
  • Upgrade Go/module dependencies and refresh lint/tooling configuration (Dockerfile, Makefile, golangci-lint config).
  • Migrate/refresh CI and repo automation (GitHub Actions workflows added/updated, Drone pipeline removed) and add a govulncheck wrapper script.

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
writer.go Formatting-only whitespace adjustment.
utils_linux.go Replace getBootTime() with getBootTimeOffset() based on uptime.
utils_bsd.go Replace getBootTime() with getBootTimeOffset() based on kern.boottime.
reader.go Store boot offset and compute boot time during message parsing.
reader_test.go Minor whitespace adjustments in the follow/tail test.
hack/release.sh Update release script shebang and add logic to update license dates on main.
hack/govulncheck.sh Add wrapper script to support govulncheck excludes/filtering.
go.mod Update Go version directive and dependency versions.
go.sum Update sums for upgraded dependencies.
Makefile Regenerate build/lint/test/release targets and tool versions.
Dockerfile Regenerate build/lint/test container pipeline; add govulncheck wrapper usage.
.golangci.yml Regenerate config for newer golangci-lint schema and formatter support.
.dockerignore Include new hack script in build context.
.conform.yaml Regenerate policy config (notably commit policy settings).
.github/workflows/ci.yaml Regenerate CI workflow and split lint/tests; update buildx setup and release action.
.github/workflows/slack-notify.yaml Update Slack notification workflow/action version and payload structure.
.github/workflows/slack-notify-ci-failure.yaml Add dedicated Slack notification for CI failures on main.
.github/workflows/stale.yml Add stale issue/PR management workflow.
.github/workflows/lock.yml Add issue lock workflow.
.github/renovate.json Add Renovate configuration.
.drone.yml Remove legacy Drone CI pipelines.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-project-automation github-project-automation bot moved this from In Review to Approved in Planning Mar 13, 2026
@smira
Copy link
Copy Markdown
Member Author

smira commented Mar 16, 2026

/m

@talos-bot talos-bot merged commit b53b36d into main Mar 16, 2026
19 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in Planning Mar 16, 2026
smira added a commit to smira/talos that referenced this pull request Mar 16, 2026
See siderolabs/go-kmsg#13

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
smira added a commit to smira/talos that referenced this pull request Mar 18, 2026
See siderolabs/go-kmsg#13

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
(cherry picked from commit c8a674a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants