Skip to content

Compute clock counts hibernated time after a resume (status, and a same-boot spored restart) #945

Closed

Description

@scttfrdmn

Found while fixing #928. Not yet reproduced live.

On hibernate-and-resume, the kernel's boot_id and /run both survive, because the RAM image is restored. Two places then measure running time on the wall clock from a timestamp that was recorded before the hibernation:

The daemon's own in-process count is fine. Go's time.Since uses CLOCK_MONOTONIC, which does not advance while the machine is suspended.

Expected: hibernated time is not compute (EC2 does not bill compute while hibernated). One fix is to persist CLOCK_MONOTONIC seconds instead of wall times. CLOCK_MONOTONIC is per-boot, comparable across processes, and excludes suspend. Another is to treat a large gap between the checkpoint's WrittenAt and now as not-running.

Activity

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

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