Skip to content

Commit 8da0f60

Browse files
author
Shlomi Noach
committed
fixed critical-load check for hibernation
1 parent ad47f7c commit 8da0f60

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

go/logic/throttler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,11 @@ func (this *Throttler) collectGeneralThrottleMetrics() error {
282282
return setThrottle(true, fmt.Sprintf("%s %s", variableName, err), base.NoThrottleReasonHint)
283283
}
284284

285-
if this.migrationContext.CriticalLoadHibernateSeconds > 0 {
285+
if criticalLoadMet && this.migrationContext.CriticalLoadHibernateSeconds > 0 {
286286
hibernateDuration := time.Duration(this.migrationContext.CriticalLoadHibernateSeconds) * time.Second
287287
hibernateUntilTime := time.Now().Add(hibernateDuration)
288288
atomic.StoreInt64(&this.migrationContext.HibernateUntil, hibernateUntilTime.UnixNano())
289-
log.Errorf("critical-load met. Will hibernate for the duration of %+v, until %+v", hibernateDuration, hibernateUntilTime)
289+
log.Errorf("critical-load met: %s=%d, >=%d. Will hibernate for the duration of %+v, until %+v", variableName, value, threshold, hibernateDuration, hibernateUntilTime)
290290
go func() {
291291
time.Sleep(hibernateDuration)
292292
this.migrationContext.SetThrottleGeneralCheckResult(base.NewThrottleCheckResult(true, "leaving hibernation", base.LeavingHibernationThrottleReasonHint))

0 commit comments

Comments
 (0)