Skip to content

Remote comms: Cross-incarnation wake detection #690

@sirtimid

Description

@sirtimid

Problem: The current wake detector only works within a single running process. If the kernel restarts while the system was asleep, we don't detect the time discontinuity and don't reset reconnection backoffs, causing unnecessary delays.

Expected Behavior:

  • Store last known timestamp in persistent storage on shutdown
  • On kernel startup, compare stored timestamp with current time
  • If gap exceeds threshold (e.g., > 1 hour), treat as wake event and reset all reconnection backoffs
  • Complement the existing runtime wake detector (installWakeDetector)

Implementation:

  • Add timestamp storage to kernel store (e.g., lastNetworkActivityTimestamp)
  • Write timestamp on initNetwork stop or periodically during operation
  • Check timestamp on initNetwork startup
  • If time gap > threshold, call reconnectionManager.resetAllBackoffs()
  • Integrate with initNetwork or initRemoteComms startup sequence
  • Consider edge cases: clock changes, timezone issues

Acceptance Criteria:

  • Last timestamp is stored on shutdown
  • Time discontinuity is detected on startup
  • Backoffs are reset when discontinuity detected
  • Works alongside runtime wake detector
  • Tests verify cross-incarnation detection

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions