There is only one place where we log "waking to check", and it is based on a time.Time() so it seems that the difference in m=+ or not is just based on the Time object. Maybe sometimes we're creating the time object in 2 different ways?
now := manager.config.Clock.Now()
nextTick := now.Add(manager.config.MaxSleep)
for _, info := range manager.config.Client.Leases() {
if info.Expiry.After(nextTick) {
continue
}
nextTick = info.Expiry
}
I wonder if it is a case of
nextTick := now.Add(MaxSleep)
has the monotonic timer, but
nextTick = info.Expiry
does not.
Looking at the code, it seems:
manager, err := lease.NewManager(lease.ManagerConfig{
Secretary: secretary,
Client: client,
Clock: st.clock(),
MaxSleep: time.Minute,
})
MaxSleep is defaulting to 1 minute. So it looks like we should be set up "wake up before the next lease that is about to expire, or 1 minute has passed".
I'll be updating this bug with debug-log at ms precision
There is only one place where we log "waking to check", and it is based on a time.Time() so it seems that the difference in m=+ or not is just based on the Time object. Maybe sometimes we're creating the time object in 2 different ways? config. Clock.Now( ) manager. config. MaxSleep) config. Client. Leases( ) { After(nextTick) {
now := manager.
nextTick := now.Add(
for _, info := range manager.
if info.Expiry.
continue
}
nextTick = info.Expiry
}
I wonder if it is a case of
nextTick := now.Add(MaxSleep)
has the monotonic timer, but
nextTick = info.Expiry
does not.
Looking at the code, it seems: r(lease. ManagerConfig{
manager, err := lease.NewManage
Secretary: secretary,
Client: client,
Clock: st.clock(),
MaxSleep: time.Minute,
})
MaxSleep is defaulting to 1 minute. So it looks like we should be set up "wake up before the next lease that is about to expire, or 1 minute has passed".
I'll be updating this bug with debug-log at ms precision