Skip to content

time.Sleep can block VERY long time, when drift the clock backwards #39

Description

@errpunk

in this scenario, NextID() could block very long time.

  1. in a high load: (sf.sequence + 1) & maskSequence == 0
  2. in the same time, system clock drift backwards, say 8 hours

this will block the function for 8 hour.

can we use some kind of Monotonic time or add a new function with timeout-control to avoid this?

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