Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address possible issue with skewed timestamps in system log after (re)boot with power loss #9

Merged
merged 7 commits into from
Dec 20, 2024

Conversation

defanator
Copy link
Owner

@defanator defanator commented Dec 18, 2024

Proposed changes include additional step between collecting and submitting system log after router reboot: checking the log for possible "jump" in timestamps, which may occur in cases when a router was booted after power loss and hardware clock was unsynchronized until the NTP comes into play.

Having part of log lines marked with older timestamps makes it impossible to put such entries to loki (it accepts entries no older than an hour or so by default).

New logic involves remapping timestamps for unsynchronized lines backwards from 1st line with the very first timestamp after clock was synchronized (see tests for more details).

Intended to close #5.

@defanator defanator self-assigned this Dec 18, 2024
In particular:

1. Tests do not require authorization, so it has been turned off.

2. Added "Connection: close" header to all curl invocations to avoid
unnecessary log warnings in the interim proxies like nginx if HTTP
keepalives are enabled.
@defanator defanator marked this pull request as ready for review December 18, 2024 17:58
@defanator defanator changed the title DRAFT: address issue with skewed timestamps in boot-time logs Address possible issue with skewed timestamps in system log after (re)boot with power loss Dec 20, 2024
@defanator defanator merged commit c3a89b5 into main Dec 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Portion of boot log may not be submitted due to unsynchronized clock at boot time
1 participant