Skip to content

RSDK-13299 — Log occasional warning when capture data is stale#5745

Open
n0nick wants to merge 2 commits intoviamrobotics:mainfrom
n0nick:sm/log-occassional-warning
Open

RSDK-13299 — Log occasional warning when capture data is stale#5745
n0nick wants to merge 2 commits intoviamrobotics:mainfrom
n0nick:sm/log-occassional-warning

Conversation

@n0nick
Copy link
Member

@n0nick n0nick commented Feb 11, 2026

Summary

  • Adds a rate-limited log to the disk summary tracker when the oldest file in the capture directory is significantly older than expected given the sync interval
  • Warning fires when oldest file age exceeds 10 × sync_interval_mins (with a minimum of 3 minutes), and at most once every 5 minutes
  • Dynamically checks sync state each tick via SchedulerEnabled() and ReadyToSyncDirectories():
    • WARN when sync should be actively happening but data is stale (data generating faster than uploading, or uploads failing)
    • DEBUG when sync is paused (e.g. selective sync sensor returned false) — staleness is expected, no need to alarm
  • Uses existing data.FormatBytesI64 for human-readable sizes
  • Exports sync.Config.SchedulerEnabled() and sync.ReadyToSyncDirectories()

Example log:

WARN  Capture data may not be syncing: oldest file is 5m0s old, expected less than 3m0s.
There are 42 files (5.00 MB) waiting to sync.
Data may be generating faster than it can be uploaded, or uploads may be failing.

🤖 Generated with Claude Code

Add a rate-limited WARN log to the disk summary tracker when the oldest
file in the capture directory is older than 10x the sync interval (min 3
minutes). This surfaces when data is generating faster than it can be
uploaded or when uploads are failing. The warning only fires when the
sync scheduler is enabled and is rate-limited to once every 5 minutes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Feb 11, 2026
…ytes

- Replace static schedulerEnabled bool with a shouldSync(ctx) func that
  dynamically checks both SchedulerEnabled() and ReadyToSyncDirectories()
- Log at WARN when sync should be active but data is stale; log at DEBUG
  when sync is paused (e.g. selective sync sensor returned false)
- Remove duplicate formatBytes helper, use data.FormatBytesI64 instead
- Export ReadyToSyncDirectories in sync package

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test This pull request is marked safe to test from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments